fix(docker): drop the external dockerfile frontend pin - #4
Merged
Conversation
`# syntax=docker/dockerfile:1` makes BuildKit fetch a frontend image from Docker Hub before it reads the first instruction. That fetch fails here: failed to resolve source metadata for docker.io/docker/dockerfile:1: Head "https://registry-1.docker.io/v2/docker/dockerfile/manifests/1": net/http: TLS handshake timeout Isolated to the directive itself — a two-line Dockerfile containing only the syntax comment and `FROM hello-world` reproduces it, and the same file without the comment builds in 2.3s. Regular pulls are unaffected: `docker pull node:24-alpine` completes in seconds, so this is BuildKit's registry path, not general connectivity. Nothing here needs the external frontend. The file uses only CMD, COPY, ENV, EXPOSE, FROM, RUN, USER and WORKDIR — no `RUN --mount`, heredocs or `COPY --link` — so BuildKit's built-in frontend handles it. Verified with a full `docker build`: the image builds, and running it serves HTTP 200 with the stylesheet fetching 200 at 68951 bytes. That also exercises the pnpm-workspace.yaml fix from #3 in a real image for the first time. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BaSzXHiVdswD9rKoVh9Ln4
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Removes the # syntax=docker/dockerfile:1 Dockerfile frontend pin to avoid a mandatory BuildKit registry fetch that can fail/hang in certain network/proxy environments, unblocking pnpm docker:build for this repo’s image build.
Changes:
- Removed the external Dockerfile frontend directive (
# syntax=docker/dockerfile:1) so builds rely on the built-in Dockerfile frontend.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Problem
pnpm docker:buildfails before running a single instruction:# syntax=docker/dockerfile:1tells BuildKit to fetch an external frontend image from Docker Hub before parsing the Dockerfile.Isolation
FROM hello-world— reproduces the failure.docker pull node:24-alpineanddocker pull hello-worldboth complete in seconds.So it is BuildKit's registry path specifically, not general connectivity. Docker Desktop has a proxy configured (
http.docker.internal:3128) that normal pulls use.Fix
Remove the pin. Nothing in this Dockerfile needs the external frontend — it uses only
CMD,COPY,ENV,EXPOSE,FROM,RUN,USER,WORKDIR, with noRUN --mount, heredocs, orCOPY --link. BuildKit's built-in frontend handles all of it.Verification
Full
docker buildnow succeeds, and the resulting image was run and exercised:upgrade-insecure-requests— right for Docker, which isn't Vercel)This is also the first time the
pnpm-workspace.yamlfix from #3 has been exercised in a real image build — the frozen install passes.Caveat — an environment issue remains
This PR removes one mandatory BuildKit registry round-trip, but BuildKit's registry access is still broken on this machine. After removing the directive, the first build still hung at
0/0steps for ~11 minutes resolvingnode:24-alpine; it only succeeded once I pulled that image manually so BuildKit could resolve it locally.So a clean machine, or a
node:24-alpineupdate, will hang again. Worth checking Docker Desktop → Settings → Resources → Proxies. Pre-pulling base images is the practical workaround in the meantime.🤖 Generated with Claude Code
https://claude.ai/code/session_01BaSzXHiVdswD9rKoVh9Ln4