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: unrecognized image format while importing images from tar #4460

Open
mshlain opened this issue Mar 14, 2024 · 1 comment
Open

ctr: unrecognized image format while importing images from tar #4460

mshlain opened this issue Mar 14, 2024 · 1 comment

Comments

@mshlain
Copy link

mshlain commented Mar 14, 2024

Summary

Importing images from tar file created by skopeo always fails with error:
ctr: unrecognized image format

What Should Happen Instead?

Expected the command to import all images from the tar file

Reproduction Steps

  1. install skopeo for debian 11:
    sudo apt update && sudo apt install -y skopeo

skopeo --version
skopeo version 1.2.2

  1. export private image from private repository with skopeo
    skopeo copy docker://repo.company.local/release/version/service:1.2.3.4 dir:/tmp/all_images --src-tls-verify=false
  2. tar the directory:
    tar -cvf all_images.tar all_images
  3. gzip the tar:
    gzip all_images.tar
  4. copy archive to my microk8s cluster host
  5. extract tar file:
    gzip -d all_images.tar.gz
  6. import images:
    microk8s ctr image import - < all_images.tar
  7. after some time the operation prints:
    ctr: unrecognized image format

Introspection Report

inspection-report-20240314_141408.tar.gz
microk8s version
MicroK8s v1.28.7 revision 6541

Worth to mention that archives created by 'docker save' can be imported fine

@ramki88
Copy link

ramki88 commented Apr 29, 2024

I had the same issue, skipping the parent directory while tar resolved the problem.

The folder structure should look like this

./
./blobs/
./blobs/sha256/
./blobs/sha256/e58adedfeda064c24b8ed27ab606f59dd8488b6b623bacc9e105471ae2a1f76e
./blobs/sha256/4abcf20661432fb2d719aaf90656f55c287f8ca915dc1c92ec14ff61e67fbaf8
./blobs/sha256/7b2699543f22d5b8dc8d66a5873eb246767bca37232dee1e7a3b8c9956bceb0c
./blobs/sha256/bc4e4f799925f2f66d0f70f97d9fed87410475f6f1df8a3e148cf0fc987c17b6
./blobs/sha256/ba5dc23f65d4cc4a4535bce55cf9e63b068eb02946e3422d3587e8ce803b6aab
./blobs/sha256/4be429a5fbb2e71ae7958bfa558bc637cf3a61baf40a708cb8fff532b39e52d0
./index.json
./oci-layout

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

No branches or pull requests

2 participants