In this docker article, we will be looking how to map ports between host and docker container with in Linux.
Following command runs a web server container tomcat with mapping ports.
docker run -d --name tomcat_node2 -p 92:8080 tomcat
Lets see it in ubuntu linux shell example.
In above example, we used "docker run" to start our container with using "-p" parameter to map ports between host and container port. "92:8080" tells that our host port "92" is mapped to container port "8080". We had used tomcat application server that it uses 8080.