From 5af05ea618849bace5409df059d61ed4530f683c Mon Sep 17 00:00:00 2001 From: Tony Date: Thu, 29 Sep 2022 13:13:37 +0000 Subject: [PATCH] chore: fix docker build (#10956) --- Dockerfile | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index af82c446b..1305fc78e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,13 +2,11 @@ FROM node:16-bullseye as dep-builder # Here we use the non-slim image to provide build-time deps (compilers and python), thus no need to install later. # This effectively speeds up qemu-based cross-build. -# no longer needed -#RUN ln -sf /bin/bash /bin/sh - WORKDIR /app # place ARG statement before RUN statement which need it to avoid cache miss ARG USE_CHINA_NPM_REGISTRY=0 +ARG TARGETPLATFORM RUN \ set -ex && \ if [ "$USE_CHINA_NPM_REGISTRY" = 1 ]; then \ @@ -20,6 +18,15 @@ RUN \ COPY ./yarn.lock /app/ COPY ./package.json /app/ +# required for building canvas in arm64 and arm/v7 (introduce in #10954) +RUN \ + set -ex && \ + if [ "$TARGETPLATFORM" != "linux/amd64" ]; then \ + apt-get update && \ + apt-get install -yq --no-install-recommends \ + libpango1.0-dev ; \ + fi; + # lazy install Chromium to avoid cache miss, only install production dependencies to minimize the image size RUN \ set -ex && \