How to expose two ports in docker container

Viewed 252

I am trying to expose 8080 and 9000 port from my docker container. I have added the EXPOSE keyword in docker file (not using docker compose file). But while trying to access the port from my browser, able to access 8080 but not able to access 9000

EXPOSE 8080
EXPOSE 9000

Command used to run the docker

docker run -p 8081:8080 -p 8082:9000 -t <image-name>

While am trying to access 8081 it is working as expected but not able to access 8082. I just logged in to docker container to check the exposed port

tcp        0      0 127.0.0.1:9000          0.0.0.0:*               LISTEN      1/java
tcp        0      0 0.0.0.0:8080            0.0.0.0:*               LISTEN      1/java

port 9000 is exposed in 127.0.0.1. So how to change that to 0.0.0.0 ?

0 Answers
Related