Skip to content

fix(docker): declare NGINX_BASE_IMAGE before first FROM for BuildKit#164

Open
zxdsgz1412 wants to merge 1 commit into
OpenDCAI:mainfrom
zxdsgz1412:fix/frontend-dockerfile-nginx-arg
Open

fix(docker): declare NGINX_BASE_IMAGE before first FROM for BuildKit#164
zxdsgz1412 wants to merge 1 commit into
OpenDCAI:mainfrom
zxdsgz1412:fix/frontend-dockerfile-nginx-arg

Conversation

@zxdsgz1412

Copy link
Copy Markdown

What changed

Moved the ARG NGINX_BASE_IMAGE declaration in frontend-workflow/Dockerfile from inside the node build stage to the global scope (before the first FROM), keeping the same nginx:alpine default.

Why

ARGs referenced by a FROM instruction must be declared in the global scope. The previous placement (inside the build stage, line 31) is out of scope for the following FROM ${NGINX_BASE_IMAGE}, so newer BuildKit / Docker Compose versions resolve it as blank and the frontend image build fails:

#3 WARN: UndefinedArgInFrom: FROM argument 'NGINX_BASE_IMAGE' is not declared (line 32)
target paper2any-frontend: failed to solve: base name (${NGINX_BASE_IMAGE}) should not be blank

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

  • Behavior is unchanged for builds that pass NGINX_BASE_IMAGE explicitly (e.g. via deploy/docker.env); this only fixes the default resolution.
  • NODE_BASE_IMAGE was already declared globally, so only the nginx ARG needed moving.

🤖 Generated with Claude Code

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>
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.

1 participant