Port Mappings

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

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 using port mappings.

What are port mappings?

Port mappings let you map a container to a port on the Docker host. Any traffic hitting the Docker host on the configured port will be directed to the container.

Get hands-on with 1400+ tech skills courses.