Skip to content

feat(oci): directly load from cache if possible - #14466

Open
gzm0 wants to merge 1 commit into
docker:mainfrom
gzm0:14460-short
Open

gzm0 wants to merge 1 commit into
docker:mainfrom
gzm0:14460-short

Conversation

@gzm0

@gzm0 gzm0 commented Nov 5, 2026 •

Copy link
Copy Markdown

What this PR does

If an oci artifact is sha-pinned and we have it in the cache, don't
even talk to the registry.

The primary use case is operational safety in case of registry failure:
This allows to still work with a compose config that
includes: oci:// if it has been pulled before.

This aligns the behavior with docker itself: images are kept locally,
so it is not necessary for the registry to be up to, say, recreate an
existing container with a modified environment.

Related issue

Fixes #14460.

Changes made

  • Check eagerly if ref digest exists in cache
  • Add test.

Testing done

  • Unit tests pass: make test
  • E2E tests pass: make e2e-compose or make e2e-compose-standalone (fail locally, looks like infrastructure failure, similar failures on main)
  • Linting passes: make lint
  • Code formatted: make fmt
  • Manually tested (describe): checked that test fails w/o fix.

Additional context

Depends / based on #14462

image

@gzm0

gzm0 commented Nov 5, 2026

Copy link
Copy Markdown
Author

Draft because of the base PR.

Fixes docker#14460.

If an oci artifact is sha-pinned and we have it in the cache, don't
even talk to the registry.

The primary use case is operational safety in case of registry failure:
This allows to still work with a compose config that
`includes: oci://` if it has been pulled before.

This aligns the behavior with docker itself: images are kept locally,
so it is not necessary for the registry to be up to, say, recreate an
existing container with a modified environment.

Signed-off-by: Tobias Schlatter <schlatter.tobias@gmail.com>
@gzm0
gzm0 marked this pull request as ready for review November 7, 2026 07:55
@gzm0
gzm0 requested review from a team as code owners November 7, 2026 07:55
@gzm0
gzm0 requested review from glours and ndeloof November 7, 2026 07:55
@gzm0

gzm0 commented Nov 7, 2026

Copy link
Copy Markdown
Author

Rebased on main. Ready for review.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

oci: do not round-trip to registry when a pinned manifest is available locally

1 participant