2

I'm trying to follow the Docker Get Started guide. Currently I'm at part 4. Everything up until the point

docker stack deploy -c docker-compose.yml getstartedlab

worked well. However, after trying to deploy the services, when I run docker stack ps getstartedlab, I see that the swarm manager keeps trying to restart the containers, since every time they get the error "No such image: username/get-st…" and have their state as "Rejected 6 seconds ago" etc.

I tried to search for solutions a bit but surprisingly it seems that nobody encountered this error before whatsoever. The issue here and a similar section in the Get Started guide talks about situations where one wants to pull from a private registry. However, throughout the tutorial I've been working with the default public registry. All previous steps (e.g. launching the swarm locally, without using virtualbox) worked fine.

Versions:

  • Docker version 18.02.0-ce, build fc4de447b5
  • Virtualbox 5.2.8 r120774
  • System Kernel: 4.14.25-1-MANJARO

Any idea what might have been the problem?

xji
  • 7,341
  • 4
  • 40
  • 61

1 Answers1

1

Surprisingly passing in the flag --with-registry-auth worked even though my repo is apparently on Docker Hub. Not sure what the problem was but maybe the claim that one would only need this flag if they're using a private registry is a bit inaccurate then.

xji
  • 7,341
  • 4
  • 40
  • 61
  • 1
    That should be public repository, not registry. You can have a public repository like docker hub with private images, and vice versa. Which doc were you looking at that needs to be updated? – BMitch Mar 15 '18 at 21:29
  • 1
    @BMitch I suspected so as well. It's the following passage in Get Started part 4 that caused confusion: `Note: If your image is stored on a private registry instead of Docker Hub, you need to be logged in using docker login and then you need to add the --with-registry-auth flag to the above command. For example:`... Also, the tutorial text still listed the command without `--with-registry-auth`, which would lead to failures even if the reader has followed parts 1 to 3 step-by-step up to that point, since apparently a private image would be created in part 1, at least in my case – xji Mar 15 '18 at 23:39
  • I certainly understand the confusion with the flag name. The challenge is that logins only apply to a registry server, not a repository on a registry, so the auth credentials being passed are registry auth credentials. If you are currently logged into docker, there's an edit button on the top right of their docs pages to submit improvements. – BMitch Mar 16 '18 at 00:07
  • 1
    I went ahead and submitted the following doc update request for you: https://github.com/docker/docker.github.io/issues/6239 – BMitch Mar 16 '18 at 00:36