...

/

External Access Via Port Mappings

External Access Via Port Mappings

Let's learn how to map container ports to Docker host's ports.

Port mapping for container access

So far, we've said that containers on bridge networks can only communicate with other containers on the same network. However, you can get around this by mapping containers to ports on the Docker host. It's a bit clunky and has a lot of limitations, but it might be useful for occasional testing and development work.

The figure below shows a single Docker host running two containers. The web container on the right is running a web server on port 80 that is mapped to port 5005 on the Docker host. The client ...