Variables defined via ARG can't be used in COPY --from=$ARG /source /target.
Example:
FROM scratch
ARG SOURCE=debian:11
COPY --from=$SOURCE /etc/os-release /target
$ DOCKER_BUILDKIT=1 docker build
...
failed to solve with frontend dockerfile.v0: failed to create LLB definition: failed to parse stage name "$SOURCE": invalid reference format: repository name must be lowercase
FYI, the variable in a source or target definintion, e.g. COPY --from=debian:11 /etc/os-release /target/$SOURCE, gets expanded correctly both with and without DOCKER_BUILDKIT=1.
May be related to #815.
Variables defined via
ARGcan't be used inCOPY --from=$ARG /source /target.Example:
FYI, the variable in a source or target definintion, e.g.
COPY --from=debian:11 /etc/os-release /target/$SOURCE, gets expanded correctly both with and withoutDOCKER_BUILDKIT=1.May be related to #815.