masipcat / wireguard-go-docker

Wireguard docker image
https://hub.docker.com/r/masipcat/wireguard-go
GNU General Public License v3.0
195 stars 41 forks source link

PostDown commands are ignored when stopping the container #17

Closed bigcookie closed 4 years ago

bigcookie commented 4 years ago

Hi,

I set up the server according to your guideline - all works. Unfortunately the "PostDown" commands are not executed when stopping the container. They are only executed, when using "wg-quick wg0 down" inside the container. Now I need to manually clean iptables in case of container was stopped.

Additional ask - not a bug (sorry for putting it in the bug description) It would also be great, if you can add a command to simply run a docker container without docker-compose. This is useful for people who run the containers on a NAS like QNAP and Synology as those only allow to run docker-compose from commandline and some people prefer the GUI. Additionally I dont have too much experience with docker and any help is appreciated. I reverse-engineerd the run command for me to be - not sure if this is ideal, but it works.:

docker run \ --name "/wireguard_1" \ --privileged \ --runtime "runc" \ --restart "" \ --volume "/share/Container/Wireguard/etc_wireguard:/etc/wireguard:rw" \ --volume "/dev/net/tun:/dev/net/tun:rw" \ --log-driver "json-file" \ --restart "always" \ --cap-add "NET_ADMIN" \ --network "host" \ --hostname "AndroNAS" \ --expose "51820/udp" \ --env "LOG_LEVEL=info" \ --env "WG_COLOR_MODE=always" \ --env "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \ --label "com.qnap.qcs.gpu"="False" \ --label "com.qnap.qcs.network.mode"="host" \ --detach \ "masipcat/wireguard-go:latest" \ "/entrypoint.sh"

bigcookie commented 4 years ago

The above seems not to be a bug. I had the issue when using commandline in QNAP systems. Using the GUI, all seems to work as expected. Therefore closing.