Skip to content

Commit

Permalink
chore: fix docker build (DIYgod#10956)
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyRL authored Sep 29, 2022
1 parent 578a644 commit 5af05ea
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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 && \
Expand Down

0 comments on commit 5af05ea

Please sign in to comment.