Docker Community Forums

Share and learn in the Docker community.

Push access in registry v2


(Bingzhang) #1

I read about registry v2 api, https://docs.docker.com/registry/spec/api/

I have some code below to get access token from my repos in docker hub, but it seems I only have pull access instead of pull and push access.

Should I do login then I can get push access and what apis to do login, please?

REGISTRY=https://registry.hub.docker.com/v2

URI="$REGISTRY/$REPO/manifests/$TAG"
echo “URI:” $URI
MANIFEST="curl -sL -o /dev/null -D- $URI
CHALLENGE=”grep "Www-Authenticate" <<<"$MANIFEST""

echo $CHALLENGE


(Bingzhang) #2

Client:
Version: 17.03.1-ce
API version: 1.27
Go version: go1.7.5
Git commit: c6d412e
Built: Tue Mar 28 00:40:02 2017
OS/Arch: darwin/amd64

Server:
Version: 17.03.1-ce
API version: 1.27 (minimum version 1.12)
Go version: go1.7.5
Git commit: c6d412e
Built: Fri Mar 24 00:00:50 2017
OS/Arch: linux/amd64
Experimental: true