-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow to push local docker images by digest #78
Conversation
Question (haven't looked closely, so bear with me); will the image that was pushed be tagged? If not, it may be worth checking with the Docker Hub team; I seem to recall that images that have never been tagged may be garbage-collected after some time. Haven't looked what the UX for this looks like, but there has been prior discussion in There was an alternative proposal that was "accepted", but on hold, pending containerd integration; moby/moby#38880 (comment) That alternative uses a flag (name to be decided on, but currently docker push --local=<local-image> \
myregistry/an-image:v1 \
myregistry/an-image:v1.0 \
myregistry/an-image:v1.0.2 \
myregistry/an-image:latest |
np 😉
Yes, images are tagged and then pushed, and then the index will allow to not be garbaged collected as they are referenced. The main workflow was done in #76. This PR only adds the possibility to do it with a digest as the source and not an image. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Manually tested, LGTM.
4b7c461
to
b5c9a47
Compare
In the case `contentDigest` is defined (for example after a build by docker app) try to push local docker image from the digest. In that case, the `image` of the service is not defined in the bundle.json. If `contentDigest` is empty, do the same thing as before, so try to resolve and if it's not resolvable try to push. The service name is now displayed in error messages to better understand what's going on on failures. -- A `internal.ImageClient` interface has been added to only deal with methods from Docker's `ImageAPIClient` we need. Easier to mock for example. Signed-off-by: Yves Brissaud <yves.brissaud@docker.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
In the case
contentDigest
is defined (for example after a buildby docker app) try to push local docker image from the digest.
In that case, the
image
of the service is not defined in thebundle.json.
If
contentDigest
is empty, do the same thing as before, so try to resolveand if it's not resolvable try to push.
The service name is now displayed in error messages to better understand
what's going on on failures.
Signed-off-by: Yves Brissaud yves.brissaud@docker.com