Skip to content

containertool should mount the base image into the destination repository if possible #110

@euanh

Description

@euanh

The registry may offer a mount operation which causes a blob in one repository to appear in another repository without copying it:

https://github.com/opencontainers/distribution-spec/blob/main/spec.md#mounting-a-blob-from-another-repository

Currently, containertool copies the base image from the source repository to the local machine, then copies it back up to the destination repository. It skips this step if the base image's blobs are already present in the destination repository.

If the source and destination repositories are on the same registry, containertool should try to mount the base image from the source to the destination; if this fails, it should fall back to its current behaviour and copy the image.

N.B. Some registries, such as Artifactory, appear to mount blobs from one repository into another automatically. This behaviour may depend on the registry's configuration and the user's permissions.

To demonstrate:

  • Start with an existing repository E containing a known blob B
  • Create a new, empty repository R
  • Query whether B exists in R - some registries respond with true.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions