Docker stack deploy WITH --with-registry-auth results in "No such image error"

Hi all,

I try to deploy an Apache Tomcat service using a docker-compose.yml and a Dockerfile.

I try to deploy the service to the swarm using
docker login -u username -p password organization
first, followed by
docker stack deploy -c docker-compose.yml test --with-registry-auth

When looking at my service on the server using docker service ps test_tomcat --no-trunc I get:

DESIRED STATE    CURRENT STATE    ERROR
Shutdown    Rejected about an hour ago    "No such image: gitlab...."

I tried searching for answers online (e.g. here or here) and everybody seems to suggest the same thing: using --with-registry-auth, since the worker node cannot find the image on the manager node (image is on the manager node). But I am already using this --with-registry-auth in my docker stack deploy command.

What exactly else could it be?

Hi! Try to reorder options:
docker stack deploy –with-registry-auth -c docker-compose.yml test

1 Like