Story #5027
closedAs a user, I can 'docker push' to a Pulp repository
100%
Description
Motivation¶
There are currently two upload workflows for Pulp 3 users. Most plugins are encouraged to provide support for the latter.
Basic Upload¶
1. Create a repository named 'foo'
2. Upload an artifact
3. Create content unit
4. Create a new repository version of 'foo' from the content unit
Smart Upload¶
1. Create a repository name 'foo'
2. Upload content unit and create a repository version
The Smart Upload for the Docker plugin needs to support creating repository versions using a docker client.
Smart Upload for Docker¶
1. Create a repository named 'foo'
2. docker tag docker tag 0e5574283393 <pulp-hostname>:24817/foo
3. docker push <pulp-hostname>:24817/foo
Step 3 above creates a new repository version of 'foo' that contains a manifest '0e5574283393', a tag 'latest' pointing to the manifest, and all other manifests and blobs associated with manifest '0e5574283393'. The latest repository version of 'foo' can be consumed using docker client
4. docker pull <pulp-hostname>:24817/foo
Required REST APIs¶
/v2/ - GET¶
/v2/<repository-name>/blobs/<digest> - HEAD, GET¶
/v2/<repository-name>/blobs/<digest>/uploads - POST¶
/v2/<repository-name>/blobs/<digest>/uploads/<uuid> - HEAD, GET, PUT, PATCH¶
/v2/<repository-name>/manifests/<digest or tag> - HEAD, GET, PUT¶
etherpad for reference for the endpoints https://etherpad.net/p/docker_push
Related issues
Adds REST APIs needed to perform docker/podman push
The user needs to create a Container Repository with a name that they will use to perform a push with. e.g. foo/bar
http :/pulp/api/v3/repositories/container/container/ name='foo/bar'
podman tag dhak235a localhost:24817/foo/bar podman push localhost:24817/foo/bar
Then the content can be pulled backed from Pulp by creating a distribution with the a base path that matches the name of the repository and has the repository associated with it. e.g. base_path='foo/bar' repository=
http :/pulp/api/v3/distributions/container/container/ name=foo base_path='foo/bar'
repository=/pulp/api/v3/repositories/container/container/1b5f0ac4-a911-42b8-bd36-4d497e6e9292/
podman pull localhost:24816/foo/bar
Note the difference in the port numbers of the two APIs.
re: #5027 https://pulp.plan.io/issues/5027