I’ve been following the docs here:
I’m trying to get a token which grants me push access to my repository:
https://hub.docker.com/r/boondocks/device-api/
I’m using these values for the form:
Service = "registry.docker.io";
Realm = "https://auth.docker.io/token";
Scope = "repository:boondocks/device-api:push";
I don’t seem to be able to POST to the specified realm. This is strange because the docs specifically describe this:
POST /token HTTP/1.1
Host: auth.docker.io
Content-Type: application/x-www-form-urlencoded
grant_type=password&username=johndoe&password=A3ddj3w&service=hub.docker.io &client_id=dockerengine&access_type=offline
What am I missing?
Figured it out:
I have been trying to use curl cmd to push an image layer to my repository on dockerhub here https://hub.docker.com/r/patiner/busybox/ . In particular, I want to obtain a url from the registry to upload the layer via POST /v2/<name>/blobs/uploads/.
Here are my steps:
Step 1. curl -u patiner:pwd -X POST -kv https://registry-1.docker.io/v2/patiner/busybox/blobs/uploads/
Step 2. Now after the above cmd, I get “401 unauthorized” and the header of the response contains Www-Authenticate: Bearer real…
https://gist.github.com/jlhawn/8f218e7c0b14c941c41f
The username / password is sent in a basic authentication header (base64 encoded). Still not sure why the documentation states you can POST to that endpoint.