How to expose port for Docker container

We can use the "-p" flag for exposing the port for Docker container.

Command syntax is as follows.

#docker run -p hostport:containerport imagename

Here we need to replace the values of,

hostport with the number of port that to be open in node.
containerport with the number of the port that to be open in container.
imagename with the name of the image that going to use for this container.

That's all…

Leave a Reply