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.

  • How to tag a image(.tar) file of docker(container) while loading into other host?
  • docker cannot start on windows
  • docker getaddrinfo ENOTFOUND mysql
  • Pushing a Docker image with gcloud failed
  • nodejs, redis, npm and docker-compose setup
  • Issue while installing Mariadb on mcp8 through Docker
  • 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?

  • How to mix several python scripts into a shell script?
  • is there any way to build non asp.net core mvc project on mono?
  • Is it possible to use Docker Toolbox on Visual Studio Code?
  • How to define crontab in docker container with redhat
  • Best place to install antivirus with docker
  • Docker-compose open all ports
  • 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.