-1

I create a docker machine names dockerhyperv using the command docker-machine create -d hyperv dockerhyperv I have a docker-compose.yml file, call docker-compose up and the logs look good but I cannot connect to on the port from the yml file. I eventually found out about the command docker-machine ip and noticed the docker has a different IP address than my host.

I have no idea why this is the case. Does it have to do with hyper-v settings? I expect(ed) docker to run on localhost. In the past I played with the virtualbox driver but this should not interfere with hyper-v.

Bernhard Döbler
  • 1,960
  • 2
  • 25
  • 39

1 Answers1

1

Docker Machine creates a VM since any OS other than Linux can't natively run containers.

In case of VirtualBox, I believe it creates port forward rules to allow things to work on localhost but is probably not the case with Hyper-V.

You could probably just the VM settings to use your external network to get an IP from your router. Check this doc for information on setting this up.

  • The [docs](https://docs.docker.com/machine/get-started/#run-containers-and-experiment-with-machine-commands) advise to look at the IP, I oversaw that. Thanks for your answer. – Bernhard Döbler Nov 09 '18 at 23:15