{{title}}
{{editor}}'s edit
{{editor}}'s edit
-
|
Hi there, another question has cropped up :) When i have a container within a docker-compose using:
I can't resolve the hostname [containername] from within my stack on the compose network [compose_network_a]. This makes sense to me, as gluetun is on the bridge network and I'm telling [containername] to use gluetun. The address isn't local anymore. I have some applications running where I need to resolve an ip or hostname for the container that is using gluetun. Prior to this configuration I'd use [containername]:port, but I can't seem to find a way of finding this container as when using inspect, it doesn't have an ip (I assume it's IP is the same as the gluetun container on 10.0.3.2 or whatever?). My docker networking knowledge is on shaky ground as it is, so I'm wondering if I'm going about this the right way? Running Should also be noted that I can access the running container just fine from outside the docker network @ [hostip]:port Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 9 replies
-
|
The containername and gluetun are the same host, so you need to use |
Beta Was this translation helpful? Give feedback.
-
|
Could it be that |
Beta Was this translation helpful? Give feedback.
-
|
@qdm12 From what I can gather I might be trying to do a similar thing and can't figure it out - I run a bunch of containers on a cloned bridge network and use the linuxserver/swag container so I can resolve domains on my LAN (eg. container.landomain.com), but when I have services routed through gluetun they won't resolve on the cloned network (only via bridge ip:port). I have gluetun on the clone network as well. Is there something I need to set with Custom iptables rules? Not sure how to implement that either. |
Beta Was this translation helpful? Give feedback.
{{title}}
{{editor}}'s edit
{{editor}}'s edit
-
|
I just recently started using gluetun. Before I had an external network bridge and my containers (in separate compose files) pointed to that external network, so all containers were using that network. Then in Radarr I could just setup my deluge and sabnzb clients and also the indexers by using their container name and port number, e.g. deluge:8112. I still have separate compose files for all my containers which use the gluetun network: I tried connecting to deluge client from radarr by using gluetun:8112, but that doesn't work. When I use the ip address of the gluetun container, e.g. 172.29.28.2:8112 the connection seems to work. Both Radarr and Deluge are using network_mode: "container:gluetun" so as I understand they're both in the same network? I also read this discussion #281 but not sure if it is related. When I look in portainer at the network settings of a container that is using gluetun, I don't see it is connected to a network, but when I edit the settings, I see network is container and container is gluetun. I suppose this is correct: |
Beta Was this translation helpful? Give feedback.
-
|
Looking at the network settings of gluetun, the hostname is: 668a87f12449 and not gluetun. How can I make sure in the docker-compose file of gluetun that host is set to gluetun? My compose file is as follows: |
Beta Was this translation helpful? Give feedback.
-
|
I'm using docker-compose also and only use portainer as graphical interface to check things and stop/start containers every now and then. Would you happen to have an example of a docker-compose file where you set static IP for gluetun? And if I set static IP, I should use that instead of hostname I assume? What about the host name of gluetun? This now is 668a87f12449 instead of gluetun. If I use that it works. Is there a way to set hostname of gluetun in glueton compose file? |
Beta Was this translation helpful? Give feedback.
-
|
Adding hostname to the gluetun docker-compose file did the trick for me: |
Beta Was this translation helpful? Give feedback.



Adding hostname to the gluetun docker-compose file did the trick for me: