dockerauthenticationregistryprivateswarm

Docker registry "error authorization context"


I'm running a private docker registry. It works with docker login followed by docker push or docker pull on both the manager as well as the workers.

However if a new worker joins the swarm it can't pull the images if a service is placed onto it.

So far I have tried the following things:

None of which seem to work. The worker nodes still cant pull the images.

The registry always logs

error authorizing context: basic authentication challange for realm "Registry Realm": invalid authorization credentials

and returns a 401.

Does anyone have an idea on how to fix this or what the issue might be ?

When starting a stack on the manager node it can pull the images from the registry after setting the auth-header like in the 3rd point.


Solution

  • Solved this issue by updating the swarm service with docker service update --with-registry-auth.

    For some reason --with-registry-auth does not work with docker service create.