-
Notifications
You must be signed in to change notification settings - Fork 639
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
Support -q
in nerdctl push
#2132
Conversation
Can we make the outputs same? |
Signed-off-by: Jin Dong <[email protected]>
Updated to print ref iff $ d push -q xxxxxx/alpine
docker.io/xxxxxx/alpine:latest
$ snd push -q xxxxxx/alpine
INFO[0000] pushing as a reduced-platform image (application/vnd.docker.distribution.manifest.list.v2+json, sha256:b8c628ebeabe71102d6d889930d80a21ce2593c3ac17461b7a875220f2d876ab)
docker.io/xxxxxx/alpine:latest
$ d push xxxxxx/alpine
Using default tag: latest
The push refers to repository [docker.io/xxxxxx/alpine]
7cd52847ad77: Layer already exists
latest: digest: sha256:e2e16842c9b54d985bf1ef9242a313f36b856181f188de21313820e177002501 size: 528
$ snd push xxxxxx/alpine
INFO[0000] pushing as a reduced-platform image (application/vnd.docker.distribution.manifest.list.v2+json, sha256:b8c628ebeabe71102d6d889930d80a21ce2593c3ac17461b7a875220f2d876ab)
index-sha256:b8c628ebeabe71102d6d889930d80a21ce2593c3ac17461b7a875220f2d876ab: done |++++++++++++++++++++++++++++++++++++++|
manifest-sha256:93d5a28ff72d288d69b5997b8ba47396d2cbb62a72b5d87cd3351094b5d578a0: done |++++++++++++++++++++++++++++++++++++++|
config-sha256:042a816809aac8d0f7d7cacac7965782ee2ecac3f21bcf9f24b1de1a7387b769: done |++++++++++++++++++++++++++++++++++++++|
elapsed: 0.3 s Not sure if the logs should still be generated/printed if |
if err = signutil.Sign(rawRef, options.GOptions.Experimental, options.SignOptions); err != nil { | ||
return err | ||
} | ||
|
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.
not related to this PR. Just notice when pushing an image, sign (line 152) happens after push (line 133-150). Is this expected?
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.
not related to this PR. Just notice when pushing an image, sign (line 152) happens after push (line 133-150). Is this expected?
IIUC signing after pushing is ok (for cosign, at least), but the current implementation is wrong anyway; the Sign()
function should receive the digest from the Push()
function to prohibit TOCTOU.
(I'm mentioning this bug publicly because the cosign integration is still experimental for nerdctl)
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.
Opened an issue #2135 for further discussion
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.
Thanks
As a comparison, in docker:
# d = docker $ d push xxx/alpine Using default tag: latest The push refers to repository [docker.io/xxx/alpine] 7cd52847ad77: Mounted from library/alpine latest: digest: sha256:e2e16842c9b54d985bf1ef9242a313f36b856181f188de21313820e177002501 size: 528 $ d push -q xxx/alpine docker.io/xxx/alpine:latest