0

I have many stacks with many containers. And after some reconfigurations Docker assign new IPs for containers.

Ok, inside this network we can refer services to each other by service name or assigned alias. But what if I want to access that service name from host not at that network? That is allowed only by IP.

For example docker compose define network office-net. On that network we have OpenVPN configured, thus clients outside of office-net can reach it via VPN server. Those clients are configured to use PowerDNS server as theirs DNS server.

Could it be possible to configure Docker to export info about assigned for containers IPs into PowerDNS server? eg. gitlab.domain is at 192.168.7.3, mail.domain is at 192.168.7.4

Eugen Konkov
  • 22,193
  • 17
  • 108
  • 158
  • The container-private IP addresses aren't accessible from outside of Docker (except on one very specific host OS/Docker configuration, and then only on their local system). Normally you'd access a container through its published ports, using the host's DNS name. – David Maze Oct 29 '22 at 10:02
  • The linked question describes a couple of approaches, largely focused on `/etc/hosts`, assuming the container IPs are reachable (but in all likelihood they aren't). – David Maze Oct 29 '22 at 10:04

0 Answers0