Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix docker build #10956

Merged
merged 1 commit into from
Sep 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
chore: fix build
  • Loading branch information
TonyRL committed Sep 29, 2022
commit d740f8abf6f7b898454c879581f67695711e8ee3
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