NERSC / shifter

Shifter - Linux Containers for HPC
Other
348 stars 65 forks source link

Docker token authentication error #236

Closed uvNikita closed 5 years ago

uvNikita commented 5 years ago

Our docker registry instance allows both pull and push permissions:

$ curl -v https://our.dockerhub.registry/v2/path/to/container/manifests/latest
....
< HTTP/1.1 401 Unauthorized
< Docker-Distribution-Api-Version: registry/2.0
< WWW-Authenticate: Bearer realm="https://our.dockerhub.registry/v2/token",service="our.dockerhub.registry",scope="repository:docker-login:pull,push"
...
{"errors":[{"code":"UNAUTHORIZED","message":"authentication required","detail":null}]}

In this case, permissions are specified separated by comma: repository:docker-login:pull,push which causes the spliting logic to throw need more than 1 value to unpack error:

https://github.com/NERSC/shifter/blob/032275bbd567cd9a140ec1b50262d78ff2648c85/imagegw/shifter_imagegw/dockerv2.py#L376-L378