Port Management in docker.
docker port list port mappings or a specific mapping for the container
docker port containerName
Look up what port is mapped externally to port 5000 inside the container.
docker port nostalgic_morse 5000
0.0.0.0:49155
Redirecting the port 80 from the host to the port 80 of the container
Format
-p host_port:container_port
#or
-p IP::port
docker run -d -p 80:80 user/image
In a dockerfile, you can open a port (expose it) with the expose command
EXPOSE 80
docker port containerName 22
0.0.0.0:49154