build(Dockerfile): build static-linked lxml on arm

https://bugs.launchpad.net/lxml/+bug/1977998
Signed-off-by: Rongrong <i@rong.moe>
This commit is contained in:
Rongrong 2022-11-05 23:25:24 +08:00
parent 3a5a0ed1b2
commit 1507e3c928
No known key found for this signature in database
GPG Key ID: 1C2D45D45AB7FE94
1 changed files with 5 additions and 0 deletions

View File

@ -10,9 +10,14 @@ RUN \
COPY requirements.txt .
# temporary workaround for aarch64
ARG TARGETPLATFORM
RUN \
set -ex && \
export MAKEFLAGS="-j$((`nproc`+1))" && \
if [ "$TARGETPLATFORM" != "linux/amd64" ]; then \
CFLAGS='-O3 -g1 -pipe -fPIC -flto' LDFLAGS='-flto' STATIC_DEPS='true' pip install lxml ; \
fi && \
pip install --no-cache-dir \
-r requirements.txt \
&& \