Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

cri-containerd load image failed #638

Closed
hmtai opened this issue Mar 5, 2018 · 9 comments
Closed

cri-containerd load image failed #638

hmtai opened this issue Mar 5, 2018 · 9 comments
Labels
Milestone

Comments

@hmtai
Copy link

hmtai commented Mar 5, 2018

When I load an image with the command bellow:

cri-containerd load pause.tar

an error occurd:

Error: failed to load image: rpc error: code = Unknown desc = failed to import image: create docker manifest: layer "3a260e652b2585d5feaaf04ae480827caeba0adbc77fb84cfc6427302063cb05/layer.tar" not found

It works well with Docker.

The circtl vision:

Version:  0.1.0
RuntimeName:  cri-containerd
RuntimeVersion:  1.0.0-beta.1
RuntimeApiVersion:  0.0.0
@Random-Liu
Copy link
Member

@hmtai How do you create the pause.tar.

I tried with k8s.gcr.io/pause-amd64:3.1, and it works for me:

$ sudo ctrcri --address=/run/containerd/containerd.sock load pause.tar 
Loaded image: k8s.gcr.io/pause-amd64:3.1

@mikebrow
Copy link
Member

mikebrow commented Mar 5, 2018

Works for me with the following steps..

$ sudo docker pull k8s.gcr.io/pause-amd64:3.1
3.1: Pulling from pause-amd64
67ddbfb20a22: Pull complete 
Digest: sha256:59eec8837a4d942cc19a52b8c09ea75121acc38114a2c68b98983ce9356b8610
Status: Downloaded newer image for k8s.gcr.io/pause-amd64:3.1
$ sudo docker save k8s.gcr.io/pause-amd64:3.1 > pause.tar
$ ls pause.tar
pause.tar
$ sudo ctrcri load pause.tar 
Loaded image: k8s.gcr.io/pause-amd64:3.1

@hmtai
Copy link
Author

hmtai commented Mar 6, 2018

@Random-Liu I use docker save .I can not find the command ctrcri.How to use ctrcri?

docker save  k8s.gcr.io/pause-amd64:3.0 -o my-pause.tar

@hmtai
Copy link
Author

hmtai commented Mar 6, 2018

@Random-Liu @mikebrow Thanks a lot. I pull k8s.gcr.io/pause-amd64:3.1,it works well as you above steps. But when I pull k8s.gcr.io/pause-amd64:3.0, the same error happened...

[root@hm ~]# docker pull k8s.gcr.io/pause-amd64:3.0
3.0: Pulling from pause-amd64
a3ed95caeb02: Already exists
f11233434377: Already exists
Digest: sha256:163ac025575b775d1c0f9bf0bdd0f086883171eb475b5068e7defa4ca9e76516
Status: Image is up to date for k8s.gcr.io/pause-amd64:3.0
[root@hm~]# docker save  k8s.gcr.io/pause-amd64:3.0 -o my-pause.tar
[root@hm ~]# cri-containerd load my-pause.tar
Error: failed to load image: rpc error: code = Unknown desc = failed to import image: create docker manifest: layer "3a260e652b2585d5feaaf04ae480827caeba0adbc77fb84cfc6427302063cb05/layer.tar" not found

@hmtai
Copy link
Author

hmtai commented Mar 9, 2018

@Random-Liu @mikebrow cri-containerd load can not load the image which has link image layer?

@Random-Liu
Copy link
Member

Random-Liu commented Mar 13, 2018

@hmtai What do you mean by "link image layer"?

Hm, k8s.gcr.io/pause-amd64:3.0 doesn't work for me as well. Let me see.

@Random-Liu
Copy link
Member

@hmtai Yeah, symlink file is skipped https://github.com/containerd/cri-containerd/blob/master/pkg/containerd/importer/importer.go#L104.

I think it is for security consideration. @AkihiroSuda

Why 648a008b041c2bed7d854226dfa4a40476222c9b081a879e74b0b6bcc7578e13/layer.tar is a symlink to ../768d4f50f65f00831244703e57f64134771289e3de919a576441c9140e037ea2/layer.tar...

@qiujian16
Copy link
Contributor

docker save will create symlink for some layers https://github.com/moby/moby/blob/master/image/tarexport/save.go#L378-L385, we may not skip the symlink file?

@Random-Liu
Copy link
Member

We should fix this.

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

No branches or pull requests

4 participants