docker swarm - no need to access host possible without cap_add?
Hello, I have been reading through the issues and documentation, sadly I couldn't find anything.
I've got a docker swarm cluster and want to run an OpenVPN server on it. Since I don't need access to the host system of the container, I'm searching for a method to run the OpenVPN server without the privileged and cap_add=NET_ADMIN method (as it is still not possible in swarm mode).
I think I would need to adjust some of the files of this project, but I don't know which :)
Maybe somebody achieved this already?
Thanks in Advance!
@Haidy777 I also faced same issue today. Did you find any workaround on this? Or anyone else. I am also using swarm mode on my server.
I really don't thinks there's anyway away to get around needing --cap_add=NET_ADMIN because of the creation of the tun interface. Should be able to operate without --privileged though, that's from a time when docker didn't support cap_add.
I've made some updates on the dev branch to drop all mention of the --privileged flag. You'll always need the --cap-add=NET_ADMIN argument though.
Perhaps that helps? Let me know if you can test it.
@Aniket-Singla No, I didn't find a workaround yet.
@kylemanna Thanks, I will take a look at it this weekend. But I don't think it is possible as long as --cap-add=NET_ADMIN is needed.
For now I am using docker-compose for deployments of openvpn image in my swarm cluster (resides on master node) as I don't require CD for this beautiful image. Waiting for --cap-add to be available in swarm mode to move to stack deployments.
According to https://github.com/docker/cli/pull/2687#issuecomment-699670522 it will be available in 20.xx release