chore: fix docker build (#10956)

This commit is contained in:
Tony 2022-09-29 13:13:37 +00:00 committed by GitHub
parent 578a6442d2
commit 5af05ea618
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 3 deletions

View File

@ -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 && \