Open PeterSurda opened 2 years ago
Update on how to deal with this:
export DOCKER_BUILDKIT=1
before running docker build
ARG TARGETARCH
just after the top FROM
TARGETARCH
argument into the command line when executing the command line manually$TARGETARCH
argument in the rest of the Dockerfile can be used to distinguish between amd64
and arm64
. I haven't tested other platforms.Dockerfile
syntax doesn't support branching, the way I found to do this is to have a per-architecture stage, for example
# default
ARG TARGETARCH=amd64
FROM base AS deps-amd64 RUN apt install bla bla
FROM base AS deps-arm64 RUN apt install bla bla
FROM deps-$TARGETARCH AS travis RUN blabla
The
buildscripts/docker/Dockerfile.bionic
doesn't work on arm architecture (Apple M1, Raspberry Pi, ...).