containers / skopeo

Work with remote images registries - retrieving information, images, signing content
Apache License 2.0
8.22k stars 779 forks source link

Is there a way to cache the complete layers for copy work #2419

Closed cowcomic closed 3 weeks ago

cowcomic commented 1 month ago

With a poor network the copy work often failed A large image needs to download all the layers every time and it will fail every time. I need a way to cache the downloaded layer so that I don’t have to download it again when I copy it again after failure.

mtrmac commented 1 month ago

Thanks for reaching out.

A skopeo copy [--all --preserve-digests] docker://… dir: will create a local copy, which can then be pushed elsewhere. But for that, the whole image download needs to succeed, because a write to dir: wipes the previous contents.

Alternatively, you can run a temporary registry on localhost (maybe in a container); that one does work a layer at a time, and on a failure, restarts the copy from the failed layer (from start).

In recent versions, downloads from registries have a limited resume logic, so rare network interruptions of specific kinds don’t terminate the whole layer operation. But uploads do need to happen whole layers at a time, so if an upload is interrupted, it can only be restarted from scratch.

cowcomic commented 1 month ago

OK,i will try to use registry as a hub

github-actions[bot] commented 3 weeks ago

A friendly reminder that this issue had no activity for 30 days.

mtrmac commented 3 weeks ago

Please reopen if there are more questions.