fix(docker): declare NGINX_BASE_IMAGE before first FROM for BuildKit#164
Open
zxdsgz1412 wants to merge 1 commit into
Open
fix(docker): declare NGINX_BASE_IMAGE before first FROM for BuildKit#164zxdsgz1412 wants to merge 1 commit into
zxdsgz1412 wants to merge 1 commit into
Conversation
ARG NGINX_BASE_IMAGE was declared inside the node build stage, so it was
out of scope for the following FROM instruction. Newer BuildKit versions
resolve it as blank and fail the frontend image build with:
target paper2any-frontend: failed to solve: base name (${NGINX_BASE_IMAGE}) should not be blank
Move the declaration to the global scope (before the first FROM), where
FROM-level ARGs must live, keeping the same nginx:alpine default.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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 changed
Moved the
ARG NGINX_BASE_IMAGEdeclaration infrontend-workflow/Dockerfilefrom inside the node build stage to the global scope (before the firstFROM), keeping the samenginx:alpinedefault.Why
ARGs referenced by a
FROMinstruction must be declared in the global scope. The previous placement (inside thebuildstage, line 31) is out of scope for the followingFROM ${NGINX_BASE_IMAGE}, so newer BuildKit / Docker Compose versions resolve it as blank and the frontend image build fails:Reproduced with Docker Desktop 4.81 (Docker 29.6.1, Compose v5.2.0) on Windows running
bash deploy/docker-up.sh.Notes for reviewers
NGINX_BASE_IMAGEexplicitly (e.g. viadeploy/docker.env); this only fixes the default resolution.NODE_BASE_IMAGEwas already declared globally, so only the nginx ARG needed moving.🤖 Generated with Claude Code