Open klutchell opened 3 years ago
Ha. Indeed, despite considering multistage dockerfiles during the multiarch implementation, somehow I think we assumed that the FROM line would always be pointing to an image from a registry with an inspectable manifest. I had myself only tested references to previous stages in a COPY instruction, for example:
https://github.com/balena-io-modules/balena-multibuild/pull/96#discussion_r711400335
FROM balenalib/%%BALENA_MACHINE_NAME%%-node as base FROM --platform=linux/arm/v7 busybox as base2 FROM --platform=linux/arm/v7 debian:10 COPY --from=base /usr/local/bin/node /tmp/node COPY --from=base2 /bin/busybox /tmp/busybox CMD ["/bin/bash"]
"What is the essential nature of build
in FROM build
?" I suppose it is a reference to an image that only exists in the Docker Engine local cache. cc: @toochevere
Btw @klutchell, I assume it was typo where the Dockerfile reads FROM builder
instead of FROM build
. Right?
Yes, typo fixed. It was an example I typed very quickly and not the actual file where I reproduced the issue.
Expected Behavior
When the
FROM
target is a named build stage and not a registry image we should exclude it from the multiarch checks.Actual Behavior
When the
FROM
target is a named build stage and not a registry image we disable architecture selection.Steps to Reproduce the Problem
Create a Dockerfile where one build stage is based on another build stage.
This is uncommon usage as why bother with multiple stages in this format? The only real answer is that sometimes it's convenient to use
docker build . --target build
.Specifications