Trying to connect another container to gluetun docker container
Hi, I'm trying to connect my qbittorrent container to my gluetun container. Unfortauntely I'll always receive the error "service ***** depends on undefined service gluetun: invalid compose project" when I try to start qbittorrent from a different docker-compose.yml. When I have qbittorrent and gluetun in the same docker-compose.yml it works fine. Already created a question in the gluetun-github repo. (https://github.com/qdm12/gluetun/discussions/2462)
Does anyone of you know how to get it working with 2 seperated docker-compose.yml files? (1 for gluetun and 1 for qbittorrent)
EDIT: I solved the problem by myself:
In my gluetun docker-compose.yml I only use the following line now:network_mode: bridge
Of course there need to be a bridge device.
And in my qbittorrent compose.yml I use:network_mode: container:gluetun
Which is funny because 2 days ago it didn't work that way.
Best to put everything in one yaml. And on the same network. What other services are you trying to setup to use gluetun.
I already found a working solution for my problem. Now my qbittorrent container connects to the gluetun container as described in the the gluetun manual. I'm also using bitmagnet with gluetun.
Isn’t it the external container option you choose the other one, Add —network=container:gluetun when launching the container, provided Gluetun is already running
That is correct, I'm using this code in my qbittorrent docker-compose.yml to connect to my gluetun docker container:
That's correct, I'm using this code in my qbittorrent docker-compose.yml to connect to my gluetun docker container:
network_mode: container:gluetun
depends_on:
gluetun:
condition: service_healthy
That's correct, I'm using this code in my qbittorrent docker-compose.yml to connect to my gluetun docker container:
network_mode: container:gluetun
depends_on:
gluetun:
condition: service_healthy
Is there a reason you're using 2 separate docker-compose.yaml's?
yeah, for example if I decide to delete on of the services, then I can just remove the file and don't have to edit it
and in that case I want to have gluetun as a network container which is accessable by all my containers I configured to be able to connect.
I am having this exact same issue and can't seem to get it resolved. I keep getting this same error.
EDIT: I am an idiot. Displaying my stupidity in case this helps someone else. I was trying to publish the ports inside of qbittorrent and use gluetun as the network. Obviously this isn't possible. So, I didn't publish any ports in qbittorrent and did the publishing of the ports in gluetun (like I have all other containers) and it worked perfectly after that. Duh.