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 25, 2018 in Docker by Hannah
• 18,520 points
1,573 views

1 answer to this question.

0 votes

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 25, 2018 by Kalgi
• 52,340 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,460 points
2,223 views
+16 votes
22 answers

How can I run a ‘docker exec’ command inside a docker container?

you can run any command in a ...READ MORE

answered Dec 10, 2018 in Docker by Pramiti
1,241,167 views
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,060 points
4,183 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
7,281 views
+2 votes
1 answer
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
7,710 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 27, 2018 in Docker by Kalgi
• 52,340 points
2,743 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP