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
Fix image output #357
Fix image output #357
Conversation
73f5ddb
to
7bc591a
Compare
cmd/nerdctl/load.go
Outdated
imgs, err := client.Import(ctx, in, containerd.WithDigestRef(archive.DigestTranslator(sn)), containerd.WithAllPlatforms(clicontext.Bool("all-platforms"))) | ||
imgs, err := client.Import(ctx, in, containerd.WithAllPlatforms(clicontext.Bool("all-platforms"))) |
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.
This change makes all non-tagged images loaded by nerdctl load
get GC-ed immediately.
Example:
nerdctl pull busybox:latest
nerdctl save busybox:latest > /tmp/busybox.tar
mkdir /tmp/busybox
tar -C /tmp/busybox -xf /tmp/busybox.tar
jq 'del(.manifests[].annotations)' /tmp/busybox/index.json > /tmp/busybox/index.json.back
mv /tmp/busybox/index.json.back /tmp/busybox/index.json
jq 'del(.[].RepoTags)' /tmp/busybox/manifest.json > /tmp/busybox/manifest.json.back
mv /tmp/busybox/manifest.json.back /tmp/busybox/manifest.json
(...clear containerd cache...)
tar -C /tmp/busybox/ -c . | nerdctl load
(no image loaded here)
I believe containerd/containerd#5997 will be needed for solve it. PTAL. |
Merged |
thank you @AkihiroSuda , waiting for next containerd release to update the PR. |
@fahedouch Do we need to wait for the next release? That patch changes only client library so we can work on it with the main branch of containerd. |
@ktock Would you be interested in carrying this PR? |
@AkihiroSuda @ktock |
Thanks @fahedouch , yes, please |
Thanks @fahedouch ! |
ef07255
to
6619357
Compare
Signed-off-by: fahed dorgaa <fahed.dorgaa@gmail.com>
6619357
to
c8537da
Compare
@ktock @AkihiroSuda is it good ? |
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
avoid creating digest images for each manifest in the index.
fixing #177