Repository navigation
fix(local): an image Docker holds by its digest is used as pinned, not pulled or built again - #894
Merged
earakely-scale merged 3 commits intoNov 23, 2026
Conversation
…t pulled or built again A run pinning an image to a digest asked only whether this machine held something under the image's name. An image pulled as `docker pull <repo>@<digest>` carries no tag, so it looked absent: the run pulled again and, on a machine not logged in to the registry, built the image from its build context in its place, or failed when its Dockerfile's base was private too. And a gateway deploy on the local provider took whatever the name held as the pinned image, even another one. `named_if_held` decides for both the local provider's pull and the local sandbox's published images: held when the name holds the digest, or a build here of the image's sources, or when Docker holds the digest alone, which it then names with the image's name, over whatever that name held. Docker resolves the pinned reference on both its classic and containerd image stores. Fixes FD-6895. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A container started by the name runs something else than before, which is worth a line in the log. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… image held here holds_digest misses an image held by its digest alone, the check this pull request replaced in pull_published, so as a public name it invited the same mistake again. It's now _holds_under_name, a step of named_if_held. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
earakely-scale
deleted the
edgararakelyan/fd-6895-a-run-re-pulls-an-image-it-already
branch
November 23, 2026 20:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A run that pins an image to a digest (a bundle's
image = { ref = "<repo>@sha256:…", dockerfile = … }, a published image) now uses that image when this machine's Docker already holds it by its digest, without asking the registry, and no longer takes whatever the image's name holds as the pinned image.Before, the local provider asked only whether Docker held something under the image's name:
docker pull <repo>@<digest>leaves an image with no tag, so the run pulled again. On a machine not logged in to the registry (a private ECR image on a test VM), Docker's containerd image store refuses that pull. The run then built the image from its build context in its place, and ran that, or failed when the Dockerfile's base was private too.host_images.named_if_heldnow decides for both the local provider's pull and the local sandbox's published images. An image counts as held when:Docker resolves a pinned reference (
<repo>[:<tag>]@<digest>) on both its classic and containerd image stores. Checked on Docker 29 (containerd store) and Docker 27 (classic store):docker image inspectfinds an image held by its digest alone, anddocker tagnames it.Unchanged: an image Docker doesn't hold by its digest is pulled, and built from its build context when the pull fails. A build of the image's sources here still counts as holding it, so after a fallback build a later run uses that build even once the registry is reachable again.
FD-6895.
Proof
Unit tests:
named_if_heldfor each case: held under its name, by its digest alone (named), by its digest with its name on another image (renamed), its name on another image only (not held), absent.pullnames a digest-only image without pulling or building, with the registry refusing.named_if_heldsays aren't held.pulltests fail on main's code.End to end, on an agent-environments-admin KVM host, main against this branch. The
echo-mcpexample, its MCP server image pinned by digest in a registry that needs a login (registry:2 with htpasswd), its Dockerfile builtFROMthat private image. Docker holds the image by its digest alone, logged out. Run on both of Docker's image stores:d439530c1112), not the pinned one (875e55b37400)In the first round, before the local sandbox's check moved to
named_if_held, the renamed-name case ran the other image (a QEMU launcher, as the echo server). No sandbox, container or folder was left after either round.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge, with no outstanding findings.Summary
Local Docker reuses images already held by their pinned digest and gives them the expected name.
Reviews (8) · Last reviewed commit: "refactor(local): leave named_if_held the..." · Reviewed by Greptile