expose docker port code example
Example 1: docker port
HOST:CONTAINER
Example 2: docker expose port
docker run -p [external]:[Internal]
docker run -p 8080:80
Example 3: docker run all port mapping
docker run --network host
When running using --network host there is no need to map the ports.
All the docker container ports will be available since the network host mode
makes the container use the host's network stack.
Example 4: how to add a port to a running docker container
docker stop test01
docker commit test01 test02
docker run -p 8080:8080 -td test02