How to expose multiple ports of Container to Docker?

I used EXPOSE 8080 to expose 8080 port to the docker host in my earliest post.

I need to expose two ports, one for application access and another one for JMX monitoring.

EXPOSE 8080 48080

While running the docker, use one -p parameter for each port to be exposed as given below,

$ docker run -p 6666:8080 -p 58080:48080 messenger

 

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top