Docker Community Forums

Share and learn in the Docker community.

Can't find IP address from command line


(Cclosemudbath) #1

Expected behavior

Be able to easily find the IP of the MobyLinuxVM that is running

Actual behavior

Have to poke around Hyper-V to find the IP.

Information

  • the output of:
    • pinata diagnose -u on OSX
    • DockerDebugInfo.ps1 using Powershell on Windows
  • a reproducible case if this is a bug, Dockerfiles FTW
  • page URL if this is a docs issue or the name of a man page
  • host distribution and version ( OSX 10.10.x, OSX 10.11.x, Windows, etc )

Steps to reproduce the behavior


(Michael Friis) #2

@cclosemudbath What is your use case for having the IP? Running containers that expose ports are available on the docker host on Windows. Details are in the getting started guide: https://beta.docker.com/docs/winkit/getting-started/


(Rob Landers) #3

For some applications they may only respond to a given host name (WordPress multi-site immediately comes to mind) and there is a need to update (preferably programmatically) the hosts file. Which means there needs to be a way to programmatically get the ip address (creating a cname may create a “ICANN Clash” in the browser)


(Mario Pietsch) #4

did you try (Get-VMNetworkAdapter -VMName mobylinuxvm).IpAddresses ?
see: https://blogs.msdn.microsoft.com/taylorb/2012/12/05/retrieving-the-ip-address-of-a-vm-in-hyper-v/


(Cclosemudbath) #5

Yep that works. Would be good if there was something more straight forward
though, like the old docker machine IP command


(Mario Pietsch) #6

yea, that’s a big problem, that the docker4windows VM doesn’t register properly, to be used with docker-machine. It would just need to add a proper config.json file to C:\Users\xxxxx\.docker\machine\machines\MobiLinuxVM as far as I can see. … So for me Kitematic still is the superior concept.