Search⌘ K
AI Features

External Access via Port Mappings

Explore how to configure port mappings to allow external access to containers on Docker's bridge network. Understand the limitations of this approach for scaling and how it supports testing and development workflows.

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 ...