How to expose my docker container

0 votes

I have my docker containers in my CentOS VM. But I am not able to connect my containers outside from my base Windows system.

What should I do?

Thank You

Apr 6, 2020 in Docker by akhtar
• 38,260 points
913 views

1 answer to this question.

0 votes

Hi@akhtar,

To expose you container from outside you have to use NATing or sometimes it is also called PATing concept. It means you have use ip_forwarding concept. To do that use the below given command.

$ docker run -it -p 1234:80 --name web1 centos:latest

Hope this will help you.

Thank You

answered Apr 6, 2020 by MD
• 95,460 points

Related Questions In Docker

0 votes
1 answer

How to configure my docker container to use a different logging driver?

When you start a docker container, you ...READ MORE

answered Jul 4, 2019 in Docker by Sirajul
• 59,230 points
1,355 views
+4 votes
4 answers

How To Access a Service on Host From a Docker Container?

Adding to kalgi's answer, You can also ...READ MORE

answered Oct 16, 2018 in Docker by lina
• 8,220 points

edited Oct 16, 2018 by lina 34,134 views
0 votes
1 answer

How to run a docker command from inside the container?

You must have come across the /var/run/docker.sock file, ...READ MORE

answered Jun 28, 2018 in Docker by Sophie may
• 10,620 points
3,517 views
0 votes
2 answers

How to execute docker exec commande inside a docker container ?

You need to get inside the container ...READ MORE

answered Aug 13, 2019 in Docker by Sirajul
• 59,230 points
3,794 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,020 points
2,714 views
0 votes
1 answer

How can I connect a docker container to two docker networks that I have created?

Hi@akhtar, It's correct that the network argument of ...READ MORE

answered Mar 23, 2020 in Docker by MD
• 95,460 points
10,844 views
+1 vote
1 answer

How to install packages in a Docker container?

Hi@akhtar, To install packages in a docker container, ...READ MORE

answered Apr 15, 2020 in Docker by MD
• 95,460 points
146,966 views
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