cURL Docker registry authorization error "authentication required"

13.1k views Asked by At

I have set up docker auth server using cesanta and used mongodb for ACL everything works fine. Only issue is when I am doging curl to my registry catalog I got UNAUTHORIZED.

curl -Lk https://example.docker.com:5000/v2/_catalog

I am getting below error:

{"errors":[{"code":"UNAUTHORIZED","message":"authentication
required","detail":[{"Type":"registry","Class":"","Name":"catalog","Action":"*"}]}]}
1

There are 1 answers

2
Siyu On

You need to acquire a bearer token to be used as header for authentication. Here is a detail doc on how to get it https://github.com/docker/distribution/blob/master/docs/spec/auth/token.md