Docker for Windows: cannot assign requested address

How can I setup a multi-host running Docker 1.12 on Hyper-V?

I can easily assign a 127.x.x.x ip, but I would like to assign e.g. 10.240.0.x.

  • Only first line being read in Dockerfile
  • Docker + GNOME + tightvncserver + noVNC
  • Dockerfile build - possible to ignore error?
  • How do I run multiple commands within a Docker container in Jenkins?
  • Ember in docker with nginx can't reach server container
  • Laradock + Webpack + Hot-reload
  • This is my docker-compose.yaml:

    version: '2'
    services:
      nginx:
        image: nginx:lastest
        ports:
          - "127.0.0.100:80:80"
    

    If I try to assign 10.240.0.100 I get this error:
    Error starting userland proxy: listen tcp 10.240.0.100:80: bind: cannot assign requested address

    What am I missing? Do I have to configure Windows to support these addresses?

  • Make Docker for mac listen on a tcp port
  • Access non-IP interface in docker container
  • Gitlab CI runner configuration with cache on docker
  • Set hostname of service container to host's hostname
  • Running several apps via docker-compose
  • how to create docker image from an ISO file?
  • One Solution collect form web for “Docker for Windows: cannot assign requested address”

    Is this using Docker for Windows? With that, you’re limited to binding stuff to localhost on the host.

    If you want to test a multi-node swarm on your machine, you need to set up a separate set of VMs:

    > docker-machine create -d hyperv --hyperv-virtual-switch "Better New Virtual Switch" master
    > docker-machine create -d hyperv --hyperv-virtual-switch "Better New Virtual Switch" worker1
    > docker-machine create -d hyperv --hyperv-virtual-switch "Better New Virtual Switch" worker2
    

    Init swarm:

    > docker-machine inspect --format '{{ json .Driver.IPAddress }}' master
    "192.168.202.112"
    > docker-machine ssh master docker swarm init --advertise-addr 192.168.202.112
    To add a worker to this swarm, run the following command:
    
        docker swarm join \
        --token SWMTKN-1-4k5ljcmxs1d9q14lth4tfbg868lf8eqi5alxtvgo7s1ptyrhlu-3ihz3bfmx5622vei1smzetudf \
        192.168.202.112:2377
    

    Add the workers:

    > docker-machine ssh worker1 docker swarm join --token SWMTKN-1-4k5ljcmxs1d9q14lth4tfbg868lf8eqi5alxtvgo7s1ptyrhlu-3ihz3bfmx5622vei1smzetudf 192.168.202.112:2377
    > docker-machine ssh worker2 docker swarm join --token SWMTKN-1-4k5ljcmxs1d9q14lth4tfbg868lf8eqi5alxtvgo7s1ptyrhlu-3ihz3bfmx5622vei1smzetudf 192.168.202.112:2377
    

    SSH into the master and go to town (or use it from the host):

    > docker-machine ssh master
    > docker node ls
     ID                           HOSTNAME  STATUS  AVAILABILITY  MANAGER STATUS
     aojoo2h0uuj5hv1c9xajo67o2    worker1   Ready   Active
     eqt1yd8x52gph3axjkz8lxl1z *  master    Ready   Active        Leader
    

    Details here: https://github.com/docker/for-mac/issues/67#issuecomment-242239997

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.