chore: fix docker build (#10956)
This commit is contained in:
parent
578a6442d2
commit
5af05ea618
13
Dockerfile
13
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 && \
|
||||
|
|
|
|||
Loading…
Reference in New Issue