Dockerfile arm architecture
PeterSurda opened this issue · 1 comments
PeterSurda commented
The buildscripts/docker/Dockerfile.bionic doesn't work on arm architecture (Apple M1, Raspberry Pi, ...).
PeterSurda commented
Update on how to deal with this:
- it helps if you use BuildKit for building. You can enable it by
export DOCKER_BUILDKIT=1before runningdocker build - if BuildKit is enabled, add a new line with
ARG TARGETARCHjust after the topFROM - if BuildKit isn't enabled, you need to add the
TARGETARCHargument into the command line when executing the command line manually - then the
$TARGETARCHargument in the rest of the Dockerfile can be used to distinguish betweenamd64andarm64. I haven't tested other platforms. - since
Dockerfilesyntax doesn't support branching, the way I found to do this is to have a per-architecture stage, for example
# default
ARG TARGETARCH=amd64
# Intel and AMD
FROM base AS deps-amd64
RUN apt install bla bla
# ARM
FROM base AS deps-arm64
RUN apt install bla bla
# next stage
FROM deps-$TARGETARCH AS travis
RUN blabla