Skip to content

fix(runtime): drop tag from digest-pinned docker pull refs#70

Merged
john-royal merged 2 commits into
alchemy-run:mainfrom
asterikx:fix/docker-pull-digest-ref
Jul 20, 2026
Merged

fix(runtime): drop tag from digest-pinned docker pull refs#70
john-royal merged 2 commits into
alchemy-run:mainfrom
asterikx:fix/docker-pull-digest-ref

Conversation

@asterikx

Copy link
Copy Markdown
Contributor

Bug

docker pull repo:tag@digest fails on hosts using Docker's containerd image store with:

docker: Error response from daemon: ... cannot overwrite digest ...

The runtime hits this when pulling the egress-interceptor sidecar — its default ref combines tag and digest (cloudflare/proxy-everything:3cb1195@sha256:0ef6716c…, Docker.ts ContainerEgressInterceptorImage) — so any enableInternet container fails on first pull on such hosts (containerd store is the default on fresh Docker Desktop installs).

Fix

The digest fully pins the image, so the tag is dropped when both are present: toPullRef strips :tag only when immediately followed by @sha256: (registry ports are preserved — covered by tests). Extracted as an exported helper with unit tests in test/Docker.test.ts (4 cases: tag@digest, tag-only, digest-only, registry-with-port).

We've been running this as a local patch since 0.12.2; also just filed alchemy-run/alchemy#856 for a separate local-dev issue.

🤖 Generated with Claude Code

Docker's containerd image store rejects combined repo:tag@digest pull refs
with "cannot overwrite digest", which breaks pulling the egress interceptor
sidecar (cloudflare/proxy-everything:3cb1195@sha256:...) on hosts using the
containerd store. The digest fully pins the image, so the tag is dropped
when both are present.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@sam-goodwin

Copy link
Copy Markdown
Contributor

Please add a test that would have failed prior to this change

Exercises the pull path via a recording ChildProcessSpawner stub: fails
prior to the fix (spawned argv carried the combined repo:tag@digest ref)
and asserts the follow-up docker-tag alias keeps the original uri.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@asterikx

Copy link
Copy Markdown
Contributor Author

Done — added a behavioral test through Docker.pull in a59fcbd: a recording ChildProcessSpawner stub captures the spawned argv, and the test asserts the pull ref has the tag stripped (plus that the follow-up docker tag alias keeps the original uri).

Red/green verified against this branch:

  • with the fix reverted (run(["pull", imageUri, …])): Tests 1 failed | 5 passed — exactly the new digest-pinned case, argv carried repo:tag@digest
  • with the fix: Tests 6 passed

🤖 Generated with Claude Code

@john-royal john-royal changed the title fix(cloudflare-runtime): drop tag from digest-pinned docker pull refs fix(runtime): drop tag from digest-pinned docker pull refs Jul 20, 2026
@john-royal
john-royal merged commit a8c46ed into alchemy-run:main Jul 20, 2026
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.

3 participants