Red en Docker

Mapeo de puertos  en docker  puerto host:puerto docker

$ sudo docker run -d --name nginx2 -p 8080:80 nginx
$sudo docker ps

CONTAINER ID        IMAGE               COMMAND                  CREATED              STATUS              PORTS                   NAMES
cb10b610eef0        nginx               "nginx -g 'daemon of…"   51 seconds ago       Up 50 seconds       0.0.0.0:8080->80/tcp    nginx2

Mapea un puerto aleatorio del host

$ sudo docker run -d -P nginx
$ sudo docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED              STATUS              PORTS                   NAMES
cb10b610eef0        nginx               "nginx -g 'daemon of…"   51 seconds ago       Up 50 seconds       0.0.0.0:8080->80/tcp    nginx2
2783b74d3985        nginx               "nginx -g 'daemon of…"   About a minute ago   Up About a minute   0.0.0.0:32768->80/tcp   infallible_bartik