Docker Community Forums

Share and learn in the Docker community.

Private Docker Registry Token Authorization

Hello all,

I am currently trying to create my own private docker registry with token authorization enabled. However I am having issues when I try to authorize the token created by the authorization server.

I implemented these block to my docker run command configuration as follows (on

docker run -p 5000:5000 --restart=always --name registry \
-v `pwd`/docker/registry/config.yml:/etc/docker/registry/config.yml \
-v `pwd`/nginx/fullchain.pem:/etc/docker/registry/fullchain.pem \
-v `pwd`/nginx/privkey.pem:/etc/docker/registry/privkey.pem \
-e REGISTRY_AUTH=token \
-e REGISTRY_AUTH_TOKEN_SERVICE="Docker registry" \
-e REGISTRY_AUTH_TOKEN_ROOTCERTBUNDLE=/etc/docker/registry/fullchain.pem \
-e REGISTRY_HTTP_TLS_CERTIFICATE=/etc/docker/registry/fullchain.pem \
-e REGISTRY_HTTP_TLS_KEY=/etc/docker/registry/privkey.pem \

After the registry starts, I run docker login from some another random PC and it asks Username and Password. When I enter random username and the right token which is generated by, it throws 401 Unauthorized and I can see msg="error authorizing context: authorization token required" entry on the registry’s logs. I don’t understand what type of token it expects I return a token from to the client as a response using flask. What type of information should I return from the