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
• 14,080 points
17 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
+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
• 35,720 points

Related Questions In Docker

+2 votes
11 answers

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

I guess there’s no docker runtime in ...READ MORE

answered 6 days ago in Docker by Frank
9,348 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
• 6,900 points
38 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,250 points
266 views
+1 vote
1 answer

How to expose docker container's ip and port to outside docker host without port mapping?

you can accomplish this with IP aliasing ...READ MORE

answered Aug 2, 2018 in Docker by Kalgi
• 35,720 points
1,013 views
0 votes
1 answer
0 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
• 56,100 points
56 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
• 35,720 points
20 views
0 votes
1 answer

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.