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

Add an option for skopeo sync to delete in the destination what's missing from the source #2503

Open
ferferga opened this issue Jan 25, 2025 · 3 comments
Labels
kind/feature A request for, or a PR adding, new functionality

Comments

@ferferga
Copy link

Hello

I would like to have an exact 1:1 mirror of two repositories using Skopeo. However, from the skopeo sync description:

Synchronize images between registry repositories and local directories. Synchronization is achieved by copying all the images found at source to destination - useful when synchronizing a local container registry mirror or for populating registries running inside of air-gapped environments.

What's the difference with skopeo copy then?

In my opinion, this command should work like rclone's sync. From their docs:

Sync the source to the destination, changing the destination only. Doesn't transfer files that are identical on source and destination, testing by size and modification time or MD5SUM. Destination is updated to match source, including deleting files if necessary (except duplicate objects, see below). If you don't want to delete files from destination, use the copy command instead.

Is there any way I can do what I want? This is the command that I believe gets closer to what I want to achieve:

skopeo sync -a --preserve-digests -s docker://ghcr.io/my/image -d docker://docker.io/my/image

@ferferga ferferga changed the title slkopeo sync should delete in the destination what's missing from the source skopeo sync should delete in the destination what's missing from the source Jan 25, 2025
@mtrmac
Copy link
Contributor

mtrmac commented Jan 27, 2025

Thanks for reaching out.

I think that would be an interesting behavior, but after years of existence of skopeo sync, we simply can’t change what the command does and break existing scripts.

Adding an option would be possible — except that the underlying code doesn’t support deleting tags ( #1432 ), so that would need to be implemented first.

@mtrmac mtrmac added the kind/feature A request for, or a PR adding, new functionality label Jan 27, 2025
@mtrmac mtrmac changed the title skopeo sync should delete in the destination what's missing from the source Add an option for skopeo sync to delete in the destination what's missing from the source Jan 27, 2025
@ferferga
Copy link
Author

@mtrmac Why so? I think this can be done in a major. Current skopeo sync users just need to switch to skopeo copy for what they want to do (I don't really understand what's the difference between both commands?). So we match 1:1 rsync/rclone commands.

@mtrmac
Copy link
Contributor

mtrmac commented Jan 30, 2025

We haven’t had a new major release in years; and merely deciding to make a major release does not change the calculation that this breaks scripts and costs all existing users; “this is a major release” a description of a decision, not a reason to make that decision.

We are not very likely to run out of subcommand or option names, so breaking the existing command names seems unwarranted to me.


don't really understand what's the difference between both commands

One difference is in all the automation to list+filter tags. Plus different performance trade-offs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature A request for, or a PR adding, new functionality
Projects
None yet
Development

No branches or pull requests

2 participants