none
Docker-compose and networks RRS feed

  • Question

  • On Windows 2016 TP5, I was trying to create a simple docker-compose.yml

    Creating network "dockerdemo_default" with the default driver

    ERROR: HNS failed with error : Failed to create network

    I have seen that Stefan Scherer has tried this same feature (and he has succeeded specifying network: none). He gives this justification: 

    At the moment I only got a docker-compose.yml working with net: none in the yml file. AFAIK there are no links at the moment so you need some other way for service discovery.

    Is this a limitation of the Windows kernel features related to Docker, or a limitation in docker-compose? Or both?

    Thursday, April 28, 2016 1:58 PM

All replies

  • Having the same error message like you after the docker container worked successfully yesterday, it fails today after TP5 on Azure got some updates.

    Reported an issue: https://github.com/Microsoft/Virtualization-Documentation/issues/273

    Tuesday, May 24, 2016 1:09 PM
  • This is a known issue and is due to a limitation in our NAT implementation (WinNAT). When docker daemon starts, the Windows libnetwork plugin (working with the Host Networking Service - HNS) creates a default "nat" network using the default nat network driver. When Docker Compose is instructed to create a new network, it attempts to do so using the default nat network driver. However, WinNAT only supports one NAT network (one internal subnet prefix) per host. This causes Docker compose to report a failure when multiple networks are specified in a compose file.

    A possible work-around for this problem is to specify a non-nat network driver (e.g. transparent or l2bridge) in the compose file when creating a new network (reference: https://docs.docker.com/compose/networking/) . We will soon be adding "layering" to our network drivers so that users can specify a VLAN ID to provide isolation between networks on the same host using a single network interface.  

    Another limitation to our Windows implementation of container networking is lack of support for service discovery. Docker on Linux relies on a built-in, light-weight DNS server in the docker engine itself which does name resolution and even load balancing internally. Name:IP mappings are shared between hosts using a distributed key-value store (e.g. etcd, zookeeper). We have not ported this code to Windows but do have a fully functional DNS server which may work for resolving service names providing the container name:IP mappings are registered with a Host A record in DNS.

    We recognize that lack of support for service discovery and multiple default (nat) networks and subsequent lack of full support for Docker compose is a big hole in our story. We are actively working to fix this and will provide work-arounds as they become known to us and available.

    Thanks

    • Proposed as answer by Xied75 Monday, October 17, 2016 12:10 PM
    Friday, May 27, 2016 3:44 PM
  • Hello JMesser81,

    As Windows Server 2016 GA had recently released, curious to know if any of the above features (Service Discovery/multi-nat/layering with VLAN ID/Internal DNS & Loadbalancing)are available with the latest release?  Also kindly share approximately when will Overly Network & Swam Mode will be available for Windows.

    Thanks,

    Sasi

    Monday, October 17, 2016 6:47 AM
  • I also would like to know where does this stand, can we not reference a named container by name from the host nor other containers?
    Wednesday, November 9, 2016 4:32 PM