nydus icon indicating copy to clipboard operation
nydus copied to clipboard

Nerdctl/ctr-remote needs to support pushing Nydus images

Open adamqqqplay opened this issue 2 years ago • 7 comments

Now Nerdctl and ctr-remote can pull the Nydus images, but they do not support pushing the local images to the registry.

This is because the nydus blob is on-demand and has not been downloaded to the content store of containerd, so a not found error is reported. example-nerdctl example-ctr-remote

In scenarios that require synchronous images, it can be achieved by pulling and uploading, so it is best to support them in Nerdctl and ctr-remote.

adamqqqplay avatar Feb 21 '23 07:02 adamqqqplay

For further consideration, it may be possible to consider adding the sync subcommand to Nydusify to synchronize Nydus images between different registries.

Usage example: nydusify sync $SRC_IMAGE $DST_IMAGE

adamqqqplay avatar Feb 21 '23 07:02 adamqqqplay

Please try nerdctl --snapshotter nydus pull --unpack false tomcat:latest. It can pull image without unpacking, which means nydus-snapshotter won't tell containerd to skip downloading layers.

changweige avatar Feb 21 '23 08:02 changweige

supplement: Using nerdctl to pull nydus image with --unpack false

nerdctl pull --unpack false tomcat:latestnydusv6
nerdctl tag tomcat:latestnydusv6 ghcr.io/gechangwei/tomcat:latestnydusv6
nerdctl push --allow-nondistributable-artifacts   ghcr.io/gechangwei/tomcat:latestnydusv6

changweige avatar Feb 21 '23 10:02 changweige

supplement: Using nerdctl to pull nydus image with --unpack false

nerdctl pull --unpack false tomcat:latestnydusv6
nerdctl tag tomcat:latestnydusv6 ghcr.io/gechangwei/tomcat:latestnydusv6
nerdctl push --allow-nondistributable-artifacts   ghcr.io/gechangwei/tomcat:latestnydusv6

Thanks, this should work. But is there an easier way to do it in the future?

adamqqqplay avatar Feb 22 '23 08:02 adamqqqplay

This might not be as convenient as expected, but it is standard enough IMO. 🤣

changweige avatar Feb 22 '23 08:02 changweige

Maybe a way like skopeo copy docker://A docker://B is the simplest to copy images between repos.

imeoer avatar Feb 23 '23 06:02 imeoer

Maybe a way like skopeo copy docker://A docker://B is the simplest to copy images between repos.

This is a good idea, we can add support for Nydus blob in https://github.com/containers/image. In this way, skopeo can synchronize the nydus images.

adamqqqplay avatar Mar 01 '23 07:03 adamqqqplay