- The first port(9000) : the Docker host (you can use this port to access to your container) to access to the container from the outside.
- the second port(8080) : is the port used by your application.
Example : I want to run tomcat server in a docker container, the default port of tomcat is 8080 and I want to expose my docker on port 9000 so I have to write :
docker run -p 9000:8080 --name myTomcatContainer tomcat
So with this configuration I can access to Tomcat from outside using : http://host-ip:9000
'Docker' 카테고리의 다른 글
docker-compose, environment-2 ways how to run (0) | 2022.02.03 |
---|---|
The way how to find remote jupyter server(after connect two different containers) (0) | 2022.01.28 |
Docker error:port is already allocated (0) | 2022.01.28 |
Docker error:You have to remove (or rename) that container to be able to reuse that name. (0) | 2021.11.23 |
Docker Project 3-DockerCompose, Elasticsearch (0) | 2021.11.16 |