Browse Source

Correct logic to copy Docker image to Podman

pull/34/head
Jordan Potter 2 years ago
parent
commit
5bc50bfab4
  1. 12
      .github/workflows/ci.yml

12
.github/workflows/ci.yml

@ -44,11 +44,13 @@ jobs:
- name: Copy Docker image to Podman
run: |
sudo podman pull docker-daemon:docker.io/library/wireguard:latest
sudo podman save -o ${{ runner.temp }}/wireguard.tar docker.io/library/wireguard:latest
podman load -i ${{ runner.temp }}/wireguard.tar
- name: Test tunnel
run: |
for cmd in "docker" "sudo podman"; do
$cmd run --rm -d --name wireguard --cap-add NET_ADMIN --cap-add SYS_MODULE --sysctl net.ipv4.conf.all.src_valid_mark=1 -v ${{ github.workspace }}/wireguard.conf:/etc/wireguard/wg0.conf wireguard
for cmd in "docker" "podman" "sudo podman"; do
$cmd run --rm -d --name wireguard --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_MODULE --sysctl net.ipv4.conf.all.src_valid_mark=1 -v ${{ github.workspace }}/wireguard.conf:/etc/wireguard/wg0.conf wireguard
normal_ip=$($cmd run --rm curlimages/curl --retry 3 --retry-delay 5 ifconfig.io)
wireguard_ip=$($cmd run --rm --net=container:wireguard curlimages/curl --retry 3 --retry-delay 5 ifconfig.io)
if [ "$normal_ip" = "$wireguard_ip" ]; then echo "normal ip and wireguard ip are the same" && exit 1; fi
@ -57,7 +59,7 @@ jobs:
- name: Test kill switch
run: |
for cmd in "docker" "sudo podman"; do
for cmd in "docker" "podman" "sudo podman"; do
$cmd run --rm -d --name wireguard --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_MODULE --sysctl net.ipv4.conf.all.src_valid_mark=1 -v ${{ github.workspace }}/wireguard.conf:/etc/wireguard/wg0.conf wireguard
$cmd run --rm --net=container:wireguard curlimages/curl --retry 3 --retry-delay 5 ifconfig.io
$cmd exec wireguard wg-quick down wg0
@ -67,7 +69,7 @@ jobs:
- name: Test local subnets
run: |
for cmd in "docker" "sudo podman"; do
for cmd in "docker" "podman" "sudo podman"; do
ip_address=$(ip route get 1.2.3.4 | awk '{print $7}')
$cmd run --rm -d --name nginx -p 8080:80 nginx
$cmd run --rm -d --name wireguard --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_MODULE --sysctl net.ipv4.conf.all.src_valid_mark=1 -v ${{ github.workspace }}/wireguard.conf:/etc/wireguard/wg0.conf -e LOCAL_SUBNETS=$ip_address/32 wireguard
@ -78,7 +80,7 @@ jobs:
- name: Test exposed ports
run: |
for cmd in "docker" "sudo podman"; do
for cmd in "docker" "podman" "sudo podman"; do
$cmd run --rm -d --name wireguard --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_MODULE --sysctl net.ipv4.conf.all.src_valid_mark=1 -v ${{ github.workspace }}/wireguard.conf:/etc/wireguard/wg0.conf -p 8080:80 wireguard
$cmd run --rm -d --name nginx --net=container:wireguard nginx
sleep 3

Loading…
Cancel
Save