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.
The registry may offer a
mountoperation 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,
containertoolcopies 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,
containertoolshould try tomountthe 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:
Econtaining a known blobBRBexists inR- some registries respond withtrue.