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'
services:
    service_a:
        build: .
        container_name: docker

It creates a network default,

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

How can I access this container from host machine?

Nov 6, 2018 in Docker by Sophie may
• 9,870 points
173 views

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 172.0.0.0 MASK 255.0.0.0 10.0.75.2
answered Nov 6, 2018 by Sophie may
• 9,870 points

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,160 points

edited Oct 16, 2018 by lina 5,908 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 in Docker by Haseeb
3,317 views
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,310 points
685 views
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 19, 2018 in Docker by Tyrion anex
• 8,310 points
58 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,300 points
270 views
+1 vote
1 answer
0 votes
2 answers