infrastructure//Docker//port mapping

Port mapping is a Docker networking rule that connects a port on the host to a port inside a container, so that a service running in the container can be reached from the host. The flag `-p 9999:8545` maps host port 9999 to container port 8545. Without `-p`, a container's ports are invisible from the host.


Port mapping is a Docker networking rule that connects a port on the host to a port inside a container, so that a service running in the container can be reached from the host. The flag -p 9999:8545 maps host port 9999 to container port 8545. Without -p, a container's ports are invisible from the host.

The mapping is a controlled bridge for one specific port of one container, and the rest of the container stays isolated, so it opens no general security hole; following minimum privilege, only the RPC nodes that external clients need are mapped. -p bridges the network between host and container while -v bridges files: two bridges between the same pair, in different dimensions.