Open Apadgett879 opened 9 months ago
I have run this via portainer and it works with no issues once removed from a swarm setup
I'm trying to do something pretty similar. This would be my ideal docker-compose file:
version: '3.8'
services:
gluetun:
image: qmcgaw/gluetun
cap_add:
- NET_ADMIN
secrets:
- openvpn_user
- openvpn_password
environment:
- VPN_SERVICE_PROVIDER=protonvpn
- VPN_PORT_FORWARDING=on
- SERVER_COUNTRIES=United States
qbittorrent:
image: lscr.io/linuxserver/qbittorrent:latest
network_mode: "service:gluetun"
environment:
- WEBUI_PORT=9001
- TORRENTING_PORT=6881
volumes:
- ./container_configs/qbittorrent/config:/config
- ./container_state/qbittorrent/downloads:/downloads
ports:
- 9001:9001
- 6881:6881
- 6881:6881/udp
secrets:
openvpn_user:
external: true
openvpn_password:
external: true
Some of the things I have been reading are saying that due to the nature of Docker Swarm nodes, the various nodes could potentially be running on separate machines on the network. You could potentially have a node running the gluetun service on one node and whichever service you want to use the VPN on a different node. I haven't played around with running multiple nodes in a Docker Swarm just yet. Mainly due to another lesson learned that the initial manager node should be running on a device that's running a plain Docker Engine and not Docker Desktop. I only have Windows machines and Docker Engine must be run on Linux machines... but I digress.
The main reason Docker Swarm was looking good to me was for the secret management. Gluetun supports how Docker Swarm does secret management by allowing you to not specify your secret in the environment variable and instead reading the secret from secret files under /run/secrets/
which are added by Docker Swarm upon service start up... bit I digress again.
All of that to say this might not be the fault of gluetun. Docker Swarm might not be mature enough yet to support what we're wanting. I might have to fallback on some bad secret management practices and use the plain Docker Compose functionality instead until Docker Swarm adds support for network: "service:<service_name>"
.
Here is another thread I found that is related: https://forums.docker.com/t/routing-network-traffic-from-one-service-to-another/117816/10
I've managed to get gluetun working pretty well on docker swarm by using swarm launcher mentioned in this comment and something i have developed for the last few days. It doesn't require a special network_mode so it works pretty well with traefik or exposed ports.
Is this urgent?
Yes
Host OS
Linuyx Mint
CPU arch
x86_64
VPN service provider
Private Internet Access
What are you using to run the container
docker-compose
What is the version of Gluetun
Running latest docker image as of 02/10/2024
What's the problem 🤔
Docker swarm does not appear to support naming containers, or much more importantly Network_Mode
Share your logs (at least 10 lines)
Share your configuration