Docker for Windows: cannot assign the requested address

How to configure a multitask host using Docker 1.12 on Hyper-V?

I can easily assign 127.xxx ip, but I would like to assign, for example. 10.240.0.x.

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 the requested address

What am I missing? Should I configure Windows to support these addresses?

+4
source share
1 answer

Is Docker used for Windows? In this case, you are limited to binding the material to localhostthe host.

multi- node , :

> 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

:

> 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 ( ):

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

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

+3

Source: https://habr.com/ru/post/1652559/


All Articles