š
Port Mapping
Exposing container ports to the host
Step 1 of 3
Why Port Mapping?
Containers have isolated networking. To access a web server inside a container from your browser, you need to map a host port to the container port.
bash
docker run -p 8080:80 nginx
# host:8080 ā container:808080
Host80
Container