Containers all have the same hostname RRS feed

  • Question

  • Seems like this was noticed by someone over at the docker forum: https://github.com/docker/docker/issues/21762

    Each container started has the same host name (as returned by the hostname command): WIN-DE6U4068NAF

    The COMPUTERNAME environment variable is different for each container (it's the container id?) but that doesn't resolve to an IP address inside or outside the container. You can use the -h or --hostname argument to docker to force a host name, but this just sets COMPUTERNAME (which is still not addressable externally).

    Am I missing something?
    • Edited by wbradney Tuesday, June 14, 2016 11:18 AM
    Monday, June 13, 2016 7:27 PM

All replies

  • The name I got is WIN-SHSNAVDV03B, seems random. Are you on Azure?

    If the host name stuff is messed up, surely linking containers via network won't work then.

    Tuesday, June 14, 2016 11:07 AM
  • That's what I'm trying to figure out. There's not much point running a service in a container if you can't get at it from outside...

    I'm using a Hyper-V VM with Tech Preview 5 installed. The curious thing is that my host name is the same as the one seen by Stefan here: https://github.com/docker/docker/issues/21762

    So it looks like the host name is baked into the container image somehow.
    • Edited by wbradney Tuesday, June 14, 2016 11:18 AM
    Tuesday, June 14, 2016 11:17 AM