Port mapping
Port mapping forwards network traffic from a port in one network environment to a port in another, such as from a host to a container.
.NET in Action, Second Edition
Port mapping associates a host network port with a port exposed by a container.
- How it is used
- Makes a web service running inside a Docker container reachable through a host machine port.
- How deep it goes
- Distinguishes EXPOSE from publication and demonstrates host-to-container routing with concrete localhost URLs.
- Examples
- Uses AsciiArtSvc, EXPOSE 5101, host port 5000, localhost URLs, and Docker Desktop's port-assignment dialog.
- What you can do after
- Operate/configure a containerized web service by assigning a host port to its exposed container port.
Read how .NET in Action, Second Edition explains port mapping →
Build Python Web Apps with Streamlit
Container port mapping connects a port on the host machine to a port exposed by a Docker container.
- How it is used
- Connects browser traffic on the host to a Streamlit server running inside a Docker container.
- How deep it goes
- Explains host and container roles, command syntax, local access, and Elastic Beanstalk configuration without covering networking internals.
- Examples
- Uses 8502:8501 locally and 80:8501 for Elastic Beanstalk deployment.
- What you can do after
- Operate a containerized Streamlit app locally and configure its exposed port for Elastic Beanstalk.
Read how Build Python Web Apps with Streamlit explains port mapping →
Related concepts
- docker-compose.ymlconfigured by · docker-compose.yml is a declarative YAML configuration file that defines Docker Compose application services and their containers, networks, volumes, and runtime settings.
- containerconfigures · A software container is an isolated execution environment that packages an application and its dependencies while sharing the host operating system kernel.
- port numberuses · A port number is a numeric transport-layer identifier that directs network traffic to a service or application endpoint on a host.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

