Port redirection¶ Docker can redirect public TCP ports to your container, so it can be reached over the network. Port redirection is done on docker run using the -p flag. A port redirect is specified as PUBLIC:PRIVATE, where TCP port PUBLIC will be redirected to TCP port PRIVATE. As a special case, the public port can be omitted, in which case a random public port will be allocated. # A random PUB