{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/9784","labels_url":"https://api.github.com/repos/docker/docker/issues/9784/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/9784/comments","events_url":"https://api.github.com/repos/docker/docker/issues/9784/events","html_url":"https://github.com/docker/docker/pull/9784","id":52706833,"number":9784,"title":"Client Support for Docker Registry HTTP API V2","user":{"login":"stevvooe","id":120601,"avatar_url":"https://avatars.githubusercontent.com/u/120601?v=3","gravatar_id":"","url":"https://api.github.com/users/stevvooe","html_url":"https://github.com/stevvooe","followers_url":"https://api.github.com/users/stevvooe/followers","following_url":"https://api.github.com/users/stevvooe/following{/other_user}","gists_url":"https://api.github.com/users/stevvooe/gists{/gist_id}","starred_url":"https://api.github.com/users/stevvooe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevvooe/subscriptions","organizations_url":"https://api.github.com/users/stevvooe/orgs","repos_url":"https://api.github.com/users/stevvooe/repos","events_url":"https://api.github.com/users/stevvooe/events{/privacy}","received_events_url":"https://api.github.com/users/stevvooe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2014-12-23T01:40:14Z","updated_at":"2015-01-13T22:03:43Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/9784","html_url":"https://github.com/docker/docker/pull/9784","diff_url":"https://github.com/docker/docker/pull/9784.diff","patch_url":"https://github.com/docker/docker/pull/9784.patch"},"body":"This PR updates Docker core to support pushes and pulls of images from registries that support Docker Registry HTTP API V2, as proposed in docker/docker#9015. Specifically, functionality has been added to support the V2 API while minimizing changes to the end user experience. The reasons behind this move are to improve security and access control by moving to content addressable layers and using sign-able manifests.\r\n\r\nThis PR affects the following behavior in docker core:\r\n\r\n- `docker login`\r\n- Pull of images.\r\n- Push of images\r\n\r\nWhile the distribution side of docker core may need some refactoring work, the goal of this particular PR is to provide equivalent functionality with the new registry API. Use of a V2 registry should be transparent to the user.\r\n\r\nThis set of changes will be supported by some accompanying PR:\r\n\r\n- Docker Registry HTTP V2 specification (unsubmitted, based on docker/docker#9015).\r\n- docker logout (unsubmitted)\r\n\r\n## Overview\r\n\r\nImages may now be pushed and pulled from registries, public and private, that implement the Docker Registry HTTP API V2.  Using `registry/v2.URLBuilder`, the client code has been ported to use the URI layout described in the proposal. Definitions for routes and error codes from [next generation docker registry](https://github.com/docker/docker-registry/tree/next-generation) are included. The rest of the changes are devoted to authentication handling and modifying the flow to support image push. \r\n\r\nDuring login, if a registry supports the V2 api, the client will use the base endpoint (“/v2/”) to solicit an authentication challenge. The challenge is then used to login to the appropriate authentication provider. The results are tested against the base endpoint to confirm the credentials are correct. After login, authorization of operations on the registry is maintained using challenges and the stored credentials. If a challenge is issued during an operation against the registry, the client attempts to re-authorize the operation, if possible.\r\n\r\nUse of the new image format, covered in docker/docker#8093, is effectively transparent. Image manifests are created and signed transparently. This paves the way for future image verification features. A new API endpoint has been added to the docker engine to get the image manifest for an image. This endpoint can be used to get the image manifest from a daemon, sign it on the client, and push the signed image. The push API endpoint has also been updated to allow a signed manifest to be sent in the post body.\r\n\r\nPulling images is roughly the same as before, with most modifications to this code path consisting of URL updates and authentication management. For pushing images, the POST + PUT monolithic flow is implemented as proposed.\r\n\r\n## Testing\r\n\r\nThere are numerous cases under which the new registry may be used. We suggest that reviewers do take the time to test cases that they care about directly. To ensure that this PR is somewhat ready, we have tested the following combinations against the [next generation registry](https://github.com/docker/docker-registry/tree/next-generation):\r\n\r\n- “Production” registry with token auth\r\n- Private registry with token auth\r\n- Private registry with basic auth\r\n- Private registry with no auth\r\n\r\nIf you need help with reproducing these scenarios, please contact us directly.\r\n"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/69829492","html_url":"https://github.com/docker/docker/pull/9784#issuecomment-69829492","issue_url":"https://api.github.com/repos/docker/docker/issues/9784","id":69829492,"user":{"login":"jfrazelle","id":1445228,"avatar_url":"https://avatars.githubusercontent.com/u/1445228?v=3","gravatar_id":"","url":"https://api.github.com/users/jfrazelle","html_url":"https://github.com/jfrazelle","followers_url":"https://api.github.com/users/jfrazelle/followers","following_url":"https://api.github.com/users/jfrazelle/following{/other_user}","gists_url":"https://api.github.com/users/jfrazelle/gists{/gist_id}","starred_url":"https://api.github.com/users/jfrazelle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfrazelle/subscriptions","organizations_url":"https://api.github.com/users/jfrazelle/orgs","repos_url":"https://api.github.com/users/jfrazelle/repos","events_url":"https://api.github.com/users/jfrazelle/events{/privacy}","received_events_url":"https://api.github.com/users/jfrazelle/received_events","type":"User","site_admin":false},"created_at":"2015-01-13T22:03:43Z","updated_at":"2015-01-13T22:03:43Z","body":"I'm going to swap my binary out with this and see what I run into in the next day"}}