Docker for windows: how to access container from dev machine (by ip/dns name) -
questions seem asked don't @ all.
i have window 10 dev machine host docker windows installed. besides others networks has dockernat netwrok ip 10.0.75.1
i run containers docker-compose:
version: '2' services: service_a: build: . container_name: docker_a it created network bla_default, container has ip 172.18.0.4, ofcource can not connect 172.18.0.4 host - doesn't have netwrok interface this.
what should able access container host machine? (by ip) , if possible dns name? should add docker-compose.yml, how configure netwroks?
for me should basic, don't understand how stuff works , access container host directly.
allow access internal docker networks dev machine:
route /p add 172.0.0.0 mask 255.0.0.0 10.0.75.2 then use https://github.com/aacebedo/dnsdock enable dns discovery. tips:
> docker run -d -v /var/run/docker.sock:/var/run/docker.sock --name dnsdock --net bridge -p 53:53/udp aacebedo/dnsdock:latest-amd64 > add 127.0.0.1 dns server on dev machine > use labels described in docs have pretty dns names containers so answer on original question: yes can! oh, not actual.
make docker great again!
Comments
Post a Comment