Docker Community Forums

Share and learn in the Docker community.

Host.Docker.Internal usage

So say I have a Microsoft SQL Express Windows container (could be any service container really) with the 1433 port mapped to the host’s 61433 port (or just any available port). If I am running another container in the same Docker host that needs to access the SQL container and I am using the default NAT network (both containers are using this default NAT network), is it possible to use “host.docker.internal” + port from the container that needs to access the SQL container?

At that point it would seem that the host is like a proxy. Also, I know I can just use the host name of the SQL container to reach it from the other container. But if I can just use the “host.docker.internal” host name and port, it would make a requirement I have easier to implement.