How to access container from dev machine on Docker for windows

0 votes

I’m using a window 10 machine with docker for windows installed in it.

When I run containers using docker compose:

version: '2'
        build: .
        container_name: docker

It creates a network default,

But the container has IP, and I can’t connect to from host.

How can I access this container from host machine?

Nov 6, 2018 in Docker by Sophie may
• 10,570 points

1 answer to this question.

0 votes

What you can do is, allow access to internal docker networks from your dev machine, try this:

route /P add MASK
answered Nov 6, 2018 by Sophie may
• 10,570 points
HI,  when I execute "route /P add MASK  it says "The requested operation requires elevation."

Yes, you can't connect to your container from the host machine. Because Docker containers work in an isolated environment. So you need to expose the container.

Related Questions In Docker

+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 24,925 views
+1 vote
7 answers

How to connect to a Docker container running mysql on Windows 10?

Avoid using bind_address in your my.cnf file. I don't ...READ MORE

answered Apr 25, 2019 in Docker by Haseeb
0 votes
1 answer

How to enable/ disable Hyper-V for Docker on Windows?

You can do this from command prompt ...READ MORE

answered Sep 10, 2018 in Docker by Tyrion anex
• 8,690 points
0 votes
1 answer

How to run an image with volume on docker for windows?

Try : declaring the volume of container mounting the ...READ MORE

answered Sep 20, 2018 in Docker by Tyrion anex
• 8,690 points
+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,140 points
+1 vote
1 answer
0 votes
2 answers