👋 First off, thanks for all the awesome work on containerd!
Feature Request
I'd like to add the ability to call Import from the ctr command line without calling Unpack.
Specifically I'd like to add a --no-unpack option to ctr images load, in which case the command would return after:
|
imgs, err := client.Import(ctx, r, opts...) |
|
closeErr := r.Close() |
|
if err != nil { |
|
return err |
|
} |
|
if closeErr != nil { |
|
return closeErr |
|
} |
skipping the following:
|
log.G(ctx).Debugf("unpacking %d images", len(imgs)) |
|
|
|
for _, img := range imgs { |
|
// TODO: Allow configuration of the platform |
|
image := containerd.NewImage(client, img) |
|
|
|
// TODO: Show unpack status |
|
fmt.Printf("unpacking %s (%s)...", img.Name, img.Target.Digest) |
|
err = image.Unpack(ctx, context.String("snapshotter")) |
|
if err != nil { |
|
return err |
|
} |
|
fmt.Println("done") |
|
} |
|
return nil |
Why?
I'm building node images where Kubernetes's component images are preloaded into the containerd content store to provide fast air-gapped startup. In this case I only want to load images into the content store without unpacking them to a snapshotter.
Doing this results in a smaller image while still avoiding the need to pull images, the runtime cost of unpacking to the snapshotter seems to be small and preferable to the image size increase. I imagine this would be useful for others building airgapped images.
Context: https://github.com/kubernetes-sigs/kind, https://kind.sigs.k8s.io/
Why Not?
I could maintain a different tool specifically for this purpose, but I think this would fit into the existing ctr command trivially. If this feature is rejected I will likely wind up implementing such a tool instead.
Thanks!

cc @Random-Liu
👋 First off, thanks for all the awesome work on containerd!
Feature Request
I'd like to add the ability to call Import from the
ctrcommand line without calling Unpack.Specifically I'd like to add a
--no-unpackoption toctr images load, in which case the command would return after:containerd/cmd/ctr/commands/images/import.go
Lines 113 to 120 in a17c809
skipping the following:
containerd/cmd/ctr/commands/images/import.go
Lines 122 to 136 in a17c809
Why?
I'm building node images where Kubernetes's component images are preloaded into the containerd content store to provide fast air-gapped startup. In this case I only want to load images into the content store without unpacking them to a snapshotter.
Doing this results in a smaller image while still avoiding the need to pull images, the runtime cost of unpacking to the snapshotter seems to be small and preferable to the image size increase. I imagine this would be useful for others building airgapped images.
Context: https://github.com/kubernetes-sigs/kind, https://kind.sigs.k8s.io/
Why Not?
I could maintain a different tool specifically for this purpose, but I think this would fit into the existing ctr command trivially. If this feature is rejected I will likely wind up implementing such a tool instead.
Thanks!
cc @Random-Liu