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,030 points
51 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
• 51,830 points

Related Questions In Docker

+1 vote
12 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
• 6,960 points
226 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,540 points
1,090 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
• 51,830 points

edited Jan 16 by Kalgi 7,210 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
• 57,530 points
438 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
• 51,830 points
226 views
0 votes
1 answer