Skip to content
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

ctr images export and ctr images import are incongruous #10032

Open
NiklasRosenstein opened this issue Apr 3, 2024 · 3 comments
Open

ctr images export and ctr images import are incongruous #10032

NiklasRosenstein opened this issue Apr 3, 2024 · 3 comments
Assignees
Labels

Comments

@NiklasRosenstein
Copy link

Description

Intuitively, one would think that ctr images export followed by a ctr images import should "just work". However, it does not (always).

ctr images export --help implies that, by default, the command does not export the layers for all platforms. However, ctr images import --help suggests that it also doesn't import the layers for all platforms, which seems to me like an implicit --platform=<current_platform>?

$ ctr images export --help
NAME:
   ctr images export - Export images
[ ... ]
OPTIONS:
[ ... ]
   --platform value          Pull content from a specific platform
   --all-platforms           Exports content from all platforms
[ ... ]

$ ctr images import  --help
NAME:
   ctr images import - Import images
[ ... ]
OPTIONS:
   --all-platforms            Imports content for all platforms, false by default
   --platform value           Imports content for specific platform
[ ... ]

Steps to reproduce the issue

$ ctr images pull docker.io/library/busybox:latest
$ctr images export out.tar docker.io/library/busybox:latest
$ ctr images import out.tar
ctr: content digest sha256:b67a20380506da97caef06b5c957d548fe854443c773b0e3d0e21313190beec9: not found
$ ctr images import out.tar  --platform=linux/amd64
unpacking docker.io/library/busybox:latest (sha256:c3839dd800b9eb7603340509769c43e146a74c63dca3045a8e7dc8ee07e53966)...done

One must specify the --platform option for this to work, and the error message when it does not is anything but helpful to figure out the solution.

Describe the results you received and expected

I expect that ctr images import-ing an archive exported with ctr images export works with symmetrical flags in any case (here: no --platform on either side).

What version of containerd are you using?

containerd github.com/containerd/containerd 1.7.2

Any other relevant information

No response

Show configuration if it is related to CRI plugin.

No response

@ja-pavi
Copy link

ja-pavi commented Apr 5, 2024

Hi! I'm a UT Austin CS student working on a final project in my virtualization course where we have to contribute to an open source project. I was wondering I could get this issue assigned to me?

@dcantah
Copy link
Member

dcantah commented Apr 10, 2024

@ja-pavi Done

@drriguz
Copy link

drriguz commented Apr 12, 2024

Same issue here, I export and then import and got error says that content not found.
However, I cannot figure out what exactly is missing.
Adding --platform=linux/amd64 did solve my problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants