Docker Community Forums

Share and learn in the Docker community.

Is there any way to map DNS namein URl to container instances residing in same Docker server?

Hello,

If I have a linux server running docker, which has a number of containers, is there any way (other than a container reverse proxy) to map a given DNS name in a URL to a particular container?

So for instance, if I have machine1.mydomain.com running docker with a number of containers, and each container is hosting a tomcat instance with an SSL cert such as myapplication1.mydomain.com and testapplication2.mydomain.coml. Is there any way other than using a container reverse proxy to have dockerD map the DNS URL name to the right container?

Ken

Not possible. Either you resolve each subdomain to a different docker engine OR you will have to live with a reverse proxy / loadbalancer. If you want the container to terminate the traffic, you will need to setup a loadbalancer with SNI TCP Passthrough support. Nginx can be configured to act as such. Traefic 2.0 is able to act as such as well.