Repository navigation
Description
What is the version of your ORAS CLI
1.3.2
What would you like to be added?
Context
oras cp copies artifacts from a source repository to a target repository. However, it does not work reliably when the target is a pull-through cache.
A pull-through cache acts as a proxy for an upstream registry, letting clients pull upstream artifacts without connecting to the upstream directly. All major cloudproviders offer this feature — see Azure ACR Artifact Cache, AWS ECR pull-through cache, and Google Artifact Registry remote repositories.
When a pull-through cache is asked about a manifest it has not yet seen, it transparently fetches it from upstream and reports success, but the cache may only have hydrated a subset of the referenced content (for example, the index manifest plus a single platform's manifest and blobs from a previous docker pull on an amd64 host). The cache effectively reports objects as "present" that are, from oras' perspective, only partially materialized.
Problem
oras cp consults the target before pushing each descriptor and skips any node it reports as already existing. With a pull-through cache target this short-circuit fires on the index manifest, so oras never walks into the referenced platform manifests. The final tag PUT then fails because the registry's own validation finds the missing referenced manifests:
Error: PUT "https://<cache>.azurecr.io/v2/library/node/manifests/lts-alpine3.23":
response status code 400: manifest blob unknown:
blob unknown to registry: sha256:966edd…6095b
There is currently no way to make oras cp traverse the full source graph and push any missing referenced content to a partially-hydrated target.
Proposal
Add an opt-in flag to oras cp that disables the "trust the target's existence response" optimization for manifest descriptors and walks the full source DAG, pushing any referenced manifests or blobs that are missing in the target, before updating the tag.
Working name: --hydrate (alternatives worth discussing: --verify-existing, --ensure-complete, --no-skip-existing).
The flag should be opt-in so the default behavior — and its performance characteristics — remain unchanged.
A new subcommand (oras hydrate) is also worth considering if we expect the semantics to diverge significantly from oras cp over time, but I lean toward a flag for discoverability and to reuse the existing source/target plumbing.
Why is this needed for ORAS?
User story
As a platform engineer mirroring images into a cloud registry that has a pull-through cache enabled, I want oras cp to guarantee the target ends up with the complete artifact, even when the cache has previously been populated by a single-platform docker pull.
Scenario
- I configure Azure Container Registry with an Artifact Cache rule for docker.io/library/node.
- A teammate runs docker pull /library/node:lts-alpine3.23 from an amd64 host. ACR hydrates only the index manifest and the linux/amd64 platform manifest plus itsblobs.
- Later I run
oras cp docker.io/library/node:lts-alpine3.23 <acr>/library/node:lts-alpine3.23to mirror the full multi-arch image. oras cp sees the index manifest as "existing" in ACR, skips traversal, and the tag PUT is rejected with manifest blob unknown for one of the non-amd64 platform manifests.
Today the only workaround is to delete the partial manifest from the target before running oras cp, which requires elevated permissions on the cache and defeats the point of using it.
Are you willing to submit PRs to contribute to this feature?
- Yes, I am willing to implement it.
Activity
sajayantony commentedon Jun 9, 2026
My preference would be
--force-pushor--no-skip-existing:--force-pushis idiomatic for users coming from git-based workflows and correctly implies "push unconditionally"--no-skip-existingis the most self-documenting and makes the default behavior discoverable from the flag name aloneI'd avoid
--hydratespecifically because it describes the effect on the target (filling the cache) rather than the behavior of the command (don't trust existence checks). The latter is more consistent with flag names in tools.kichalla commentedon Jun 9, 2026
How about
oras cp --force? When importing an image with az cli, user useaz acr import --forceto indicate what they are doing.--force-push: oras 'copy' and force 'push' do not seem like to gel well even though the underlying effect is similar.oras manifest pushandoras blob pushwhich both hint at pushing from client machine to upstream where as copy is between registries.--no-skip-existing: double negations (no and skip) are usually hard to follow for user and is better to avoid.renshao commentedon Jun 9, 2026
I'm happy with both
--forceand--force-push. I think in this context the 'push' action is implied, so just using--forceis clear enough. So, I prefer slightly more--forceover--force-push.akashsinghal commentedon Jun 9, 2026
+1 on
--force. will this flag only apply to thecpor will it also apply topush?renshao commentedon Jun 10, 2026
That's a good point. Currently,
oras pushhas the same optimization logic. We can implement--forceflag for bothoras cpandoras push, so when it is set they always re-push all blobs and manifests.feat(cp,push): add --force to traverse partially-hydrated destinations
feat(cp,push): add --force to traverse partially-hydrated destinations
TerryHowe commentedon Jun 12, 2026
If there a need for an oras-go copy.go change for this?
feat(cp,push): add --force to traverse partially-hydrated destinations
feat(cp,push): add --force to traverse partially-hydrated destinations
feat(cp,push): add --force to traverse partially-hydrated destinations
TerryHowe commentedon Jul 20, 2026
Done.
feat(cp,push): add --force to traverse partially-hydrated destinations