How can I expose more than 1 port with Docker

0 votes

So I have 3 ports that should be exposed to the machine's interface. Is it possible to do this with a Docker container?

Jul 27, 2018 in Docker by Hannah
• 18,550 points
1,002 views

1 answer to this question.

+1 vote

To expose just one port, this is what you need to do:

docker run -p <host_port>:<container_port>

To expose multiple ports, simply provide multiple -p arguments:

docker run -p <host_port1>:<container_port1> -p <host_port2>:<container_port2>
answered Jul 27, 2018 by Kalgi
• 52,310 points

Related Questions In Docker

0 votes
1 answer

How can i start with DOCKER as a back-front end web dev?

Hi@aminegac, For running an application you need an ...READ MORE

answered Dec 4, 2020 in Docker by MD
• 95,180 points
112 views
+5 votes
19 answers
0 votes
2 answers

How can I inspect the file system of a failed `docker build

Failed command is a build that has ...READ MORE

answered Aug 6, 2018 in Docker by Nilesh
• 7,020 points
1,095 views
0 votes
1 answer

How do I install phantomjs with node in docker

Here is what you can try. Link for existing ...READ MORE

answered Aug 1, 2018 in Docker by Damon Salvatore
• 5,980 points
2,500 views
+2 votes
1 answer
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 58,120 points
1,153 views
0 votes
1 answer

How can I expose more than 1 port with Docker?

To expose just one port, this is ...READ MORE

answered Jul 25, 2018 in Docker by Kalgi
• 52,310 points
134 views
0 votes
1 answer