From 8c5834c297ce836bf0ad2fd18407654ae614c946 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Tue, 30 May 2023 15:47:40 +0200 Subject: docker: fix armhf builds --- docker/Dockerfile | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'docker/Dockerfile') diff --git a/docker/Dockerfile b/docker/Dockerfile index 18bffde..46a2215 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,9 +1,28 @@ FROM python:3.11-alpine AS base -FROM base AS build +FROM base AS deps RUN apk add -q --no-cache gcc libffi-dev make musl-dev +FROM deps as deps-amd64 +FROM deps as deps-arm64 + +FROM deps as deps-arm + +# The cryptography package doesn't distribute pre-built binaries for this +# platform, which is why it's built manually (and requires extra dependencies). +RUN apk add -q --no-cache cargo git openssl-dev rust + +# Unless this is set, cargo build fails with out of memory errors for some +# reason. Reference: +# +# https://github.com/docker/buildx/issues/359#issuecomment-1331443419 +# +# This is also the reason to install git as a build dependency. +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true + +FROM deps-$TARGETARCH as build + COPY ["requirements.txt", "/tmp/"] RUN pip3 install -q --no-cache-dir --target=/deps -r /tmp/requirements.txt -- cgit v1.2.3