From e712f8857934ead0f87bca6177e472dec202dd24 Mon Sep 17 00:00:00 2001 From: Joseph Ferguson Date: Mon, 3 Nov 2025 14:20:11 -0800 Subject: [PATCH] Add fontconfig to prevent crashing --- 5/alpine3.22/Dockerfile | 5 ++++- 5/bookworm/Dockerfile | 9 +++++++++ 6/alpine3.22/Dockerfile | 5 ++++- 6/bookworm/Dockerfile | 9 +++++++++ Dockerfile.template | 16 ++++++++++++++-- 5 files changed, 40 insertions(+), 4 deletions(-) diff --git a/5/alpine3.22/Dockerfile b/5/alpine3.22/Dockerfile index 80c9585c..bc696540 100644 --- a/5/alpine3.22/Dockerfile +++ b/5/alpine3.22/Dockerfile @@ -8,7 +8,10 @@ FROM node:20-alpine3.22 RUN apk add --no-cache \ # add "bash" for "[[" - bash + bash \ +# install fontconfig for sharp +# https://github.com/lovell/sharp/blob/v0.34.2/docs/src/content/docs/install.md#fonts + fontconfig # grab gosu for easy step-down from root # https://github.com/tianon/gosu/releases diff --git a/5/bookworm/Dockerfile b/5/bookworm/Dockerfile index 3b3b7f85..c3874370 100644 --- a/5/bookworm/Dockerfile +++ b/5/bookworm/Dockerfile @@ -6,6 +6,15 @@ FROM node:20-bookworm-slim +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ +# install fontconfig for sharp +# https://github.com/lovell/sharp/blob/v0.34.2/docs/src/content/docs/install.md#fonts + fontconfig \ + ; \ + rm -rf /var/lib/apt/lists/* + # grab gosu for easy step-down from root # https://github.com/tianon/gosu/releases ENV GOSU_VERSION 1.19 diff --git a/6/alpine3.22/Dockerfile b/6/alpine3.22/Dockerfile index 366a1c0d..01c81f27 100644 --- a/6/alpine3.22/Dockerfile +++ b/6/alpine3.22/Dockerfile @@ -8,7 +8,10 @@ FROM node:22-alpine3.22 RUN apk add --no-cache \ # add "bash" for "[[" - bash + bash \ +# install fontconfig for sharp +# https://github.com/lovell/sharp/blob/v0.34.2/docs/src/content/docs/install.md#fonts + fontconfig # grab gosu for easy step-down from root # https://github.com/tianon/gosu/releases diff --git a/6/bookworm/Dockerfile b/6/bookworm/Dockerfile index 4a1d68c2..2d0b9c40 100644 --- a/6/bookworm/Dockerfile +++ b/6/bookworm/Dockerfile @@ -6,6 +6,15 @@ FROM node:22-bookworm-slim +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ +# install fontconfig for sharp +# https://github.com/lovell/sharp/blob/v0.34.2/docs/src/content/docs/install.md#fonts + fontconfig \ + ; \ + rm -rf /var/lib/apt/lists/* + # grab gosu for easy step-down from root # https://github.com/tianon/gosu/releases ENV GOSU_VERSION 1.19 diff --git a/Dockerfile.template b/Dockerfile.template index 9ce74670..9ac42db3 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -13,9 +13,21 @@ FROM {{ .variants[env.variant].from }} {{ if is_alpine then ( -}} RUN apk add --no-cache \ # add "bash" for "[[" - bash + bash \ +# install fontconfig for sharp +# https://github.com/lovell/sharp/blob/v0.34.2/docs/src/content/docs/install.md#fonts + fontconfig +{{ ) else ( -}} +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ +# install fontconfig for sharp +# https://github.com/lovell/sharp/blob/v0.34.2/docs/src/content/docs/install.md#fonts + fontconfig \ + ; \ + {{ clean_apt }} +{{ ) end -}} -{{ ) else "" end -}} # grab gosu for easy step-down from root # https://github.com/tianon/gosu/releases ENV GOSU_VERSION 1.19