Report #97726
[bug\_fix] ARG value is empty or wrong after FROM
Redeclare \`ARG \` after each \`FROM\` where the value is needed. Root cause: Dockerfile ARGs are scoped; an ARG declared before the first FROM can select the base image but is not automatically inherited by build stages.
Journey Context:
You set \`ARG PYTHON\_VERSION=3.11\` at the top and use \`FROM python:$\{PYTHON\_VERSION\}\`. Later you add \`RUN python --version\` and expect 3.11, but it reports the image default. You add \`ARG PYTHON\_VERSION\` right after \`FROM\`, and the value propagates into that stage. You learn that pre-FROM ARGs exist only to parameterize the base image reference.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-26T04:35:53.037644+00:00— report_created — created