Failed to allocate gateway with docker stack

I am trying to follow the tutorial from the official documentation . It works great except for Services.

When I start 5 instances of a container (with docker stack command) the containers won't start and I get this error:

"failed to allocate gateway"

$ docker stack ps getstartedlab

ID            NAME                     IMAGE                                  NODE                       DESIRED STATE  CURRENT STATE            ERROR                             PORTS
imb6vgifjvq7  getstartedlab_web.1      seb/docker-whale:1.1  ns3553081.ip-XXX-YYY-ZZZ.eu  Ready          Rejected 4 seconds ago   "failed to allocate gateway (1…"  
ulm1tqdhzikd   \_ getstartedlab_web.1  seb/docker-whale:1.1  ns3553081.ip-XXX-YYY-ZZZ.eu  Shutdown       Rejected 9 seconds ago   "failed to allocate gateway (1…"  
...

      

Docker-compose.yml file contains

version: "3"
services:
  web:
    image: seb/docker-whale:1.1
    deploy:
      replicas: 5
      resources:
        limits:
          cpus: "0.1"
          memory: 50M
      restart_policy:
        condition: on-failure
    ports:
      - "80:80"
    networks:
      - webnet
networks:
  webnet:

      

to start containers I use the command:

$ docker stack deploy -c docker-compose.yml getstartedlab

      

I can start one container instance without any problem using the command:

$ docker run -p 80:80 seb/docker-whale:1.1

      

Any idea why it isn't working? How can I get more information about the error? Thanks for your help.

+3


source to share


1 answer


Answer from a newbie: here (version 1.13.1) the message disappeared when I changed ports "80:80" to "8080: 80". Port 80 was used by the docker host.



0


source







All Articles