What should be the contents of the X-Registry-Auth header when clicking on a Docker image in a private registry using the REST API ? Per Using the Docker API to access a private registry , the X-Registry-Auth header is required. https://groups.google.com/forum/#!topic/docker-user/vXcA8fsCNZM suggests that the value should be a base64 encoded JSON string of the form:
{'username': string, 'password': string, 'email': string, 'serveraddress' : string}
After setting the appropriate environment variables, I did:
XRA=`echo "{\"username\": \"${USERNAME}\", \"password\": \"${PASSWORD}\", \"email\": \"${EMAIL_ADDRESS}\", \"serveraddress\" : \"${SERVER_ADDRESS}\"}" | base64 --wrap=0`
curl -v --request POST --header "X-Registry-Auth: $XRA" http://$DOCKER_HOST/v1/images/$REGISTRY/$NAMESPACE/$REPOSITORY?tag=$TAG
And get an answer 403 Forbidden.
Perhaps the problem is that I do not know what the values should be. How can I identify them? Docker seems to have a way; sudo docker push $REGISTRY/$NAMESPACE/$REPOSITORY:$TAGworks fine.
source
share