From 5d9f2e41a04d7e9eccb2ceb9c3c3791dc406f562 Mon Sep 17 00:00:00 2001 From: jslocomotor <210083531+jslocomotor@users.noreply.github.com> Date: Wed, 6 May 2026 20:30:52 +0200 Subject: [PATCH 1/2] feat(images): toggle chromium installation --- docs/02-setup/02-build-setup.md | 1 + images/bench/Dockerfile | 8 ++++++-- images/custom/Containerfile | 9 +++++++-- images/production/Containerfile | 9 +++++++-- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/docs/02-setup/02-build-setup.md b/docs/02-setup/02-build-setup.md index 326de9bf..09cef899 100644 --- a/docs/02-setup/02-build-setup.md +++ b/docs/02-setup/02-build-setup.md @@ -96,6 +96,7 @@ See [Automated Builds and Deployment](../03-production/06-automated-builds-and-d | PYTHON_VERSION | Python version for the base image | | NODE_VERSION | Node.js version | | WKHTMLTOPDF_VERSION | wkhtmltopdf version | +| INSTALL_CHROMIUM | Configure chromium installation, defaults to `true` - needed for Frappe Workbench version >15 | | **bench only** | | | DEBIAN_BASE | Debian base version for the bench image, defaults to `bookworm` | | WKHTMLTOPDF_DISTRO | use the specified distro for debian package. Default is `bookworm` | diff --git a/images/bench/Dockerfile b/images/bench/Dockerfile index 9c21345d..1cb0b278 100644 --- a/images/bench/Dockerfile +++ b/images/bench/Dockerfile @@ -4,6 +4,7 @@ LABEL author=frappé ARG GIT_REPO=https://github.com/frappe/bench.git ARG GIT_BRANCH=v5.x +ARG INSTALL_CHROMIUM=true RUN apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \ @@ -23,8 +24,6 @@ RUN apt-get update \ libharfbuzz0b \ libpangoft2-1.0-0 \ libpangocairo-1.0-0 \ - #Chromium - chromium-headless-shell \ # to work inside the container locales \ build-essential \ @@ -75,6 +74,11 @@ RUN apt-get update \ file \ # For MIME type detection media-types \ + # Chromium + && if [ "$INSTALL_CHROMIUM" = "true" ]; then \ + DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \ + chromium-headless-shell; \ + fi \ && rm -rf /var/lib/apt/lists/* RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \ diff --git a/images/custom/Containerfile b/images/custom/Containerfile index 2ecb06d7..5f8072f6 100644 --- a/images/custom/Containerfile +++ b/images/custom/Containerfile @@ -8,6 +8,8 @@ COPY resources/core/nginx/security_headers.conf /etc/nginx/snippets/security_hea ARG WKHTMLTOPDF_VERSION=0.12.6.1-3 ARG WKHTMLTOPDF_DISTRO=bookworm +ARG INSTALL_CHROMIUM=true + ARG NODE_VERSION=24.13.0 ENV NVM_DIR=/home/frappe/.nvm ENV PATH=${NVM_DIR}/versions/node/v${NODE_VERSION}/bin/:${PATH} @@ -26,8 +28,6 @@ RUN useradd -ms /bin/bash frappe \ libharfbuzz0b \ libpangoft2-1.0-0 \ libpangocairo-1.0-0 \ - #Chromium - chromium-headless-shell \ # For backups restic \ gpg \ @@ -62,6 +62,11 @@ RUN useradd -ms /bin/bash frappe \ && curl -sLO https://github.com/wkhtmltopdf/packaging/releases/download/$WKHTMLTOPDF_VERSION/$downloaded_file \ && apt-get install -y ./$downloaded_file \ && rm $downloaded_file \ + # Chromium + && if [ "$INSTALL_CHROMIUM" = "true" ]; then \ + DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \ + chromium-headless-shell; \ + fi \ # Clean up && rm -rf /var/lib/apt/lists/* \ && rm -fr /etc/nginx/sites-enabled/default \ diff --git a/images/production/Containerfile b/images/production/Containerfile index f95a9703..e2a2f3ee 100644 --- a/images/production/Containerfile +++ b/images/production/Containerfile @@ -4,6 +4,8 @@ FROM python:${PYTHON_VERSION}-slim-${DEBIAN_BASE} AS base ARG WKHTMLTOPDF_VERSION=0.12.6.1-3 ARG WKHTMLTOPDF_DISTRO=bookworm +ARG INSTALL_CHROMIUM=true + ARG NODE_VERSION=24.13.0 ENV NVM_DIR=/home/frappe/.nvm ENV PATH=${NVM_DIR}/versions/node/v${NODE_VERSION}/bin/:${PATH} @@ -22,8 +24,6 @@ RUN useradd -ms /bin/bash frappe \ libharfbuzz0b \ libpangoft2-1.0-0 \ libpangocairo-1.0-0 \ - #Chromium - chromium-headless-shell \ # For backups restic \ gpg \ @@ -58,6 +58,11 @@ RUN useradd -ms /bin/bash frappe \ && curl -sLO https://github.com/wkhtmltopdf/packaging/releases/download/$WKHTMLTOPDF_VERSION/$downloaded_file \ && apt-get install -y ./$downloaded_file \ && rm $downloaded_file \ + # Chromium + && if [ "$INSTALL_CHROMIUM" = "true" ]; then \ + DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \ + chromium-headless-shell; \ + fi \ # Clean up && rm -rf /var/lib/apt/lists/* \ && rm -fr /etc/nginx/sites-enabled/default \ From 2af7b06f8d9aa20334c8acb7cbf5ab393f39ab15 Mon Sep 17 00:00:00 2001 From: jslocomotor <210083531+jslocomotor@users.noreply.github.com> Date: Thu, 7 May 2026 14:03:12 +0200 Subject: [PATCH 2/2] feat(images): permissive boolean check for INSTALL_CHROMIUM --- images/bench/Dockerfile | 2 +- images/custom/Containerfile | 2 +- images/production/Containerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/images/bench/Dockerfile b/images/bench/Dockerfile index 1cb0b278..2b2540b5 100644 --- a/images/bench/Dockerfile +++ b/images/bench/Dockerfile @@ -75,7 +75,7 @@ RUN apt-get update \ # For MIME type detection media-types \ # Chromium - && if [ "$INSTALL_CHROMIUM" = "true" ]; then \ + && if [ "$INSTALL_CHROMIUM" != "false" ]; then \ DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \ chromium-headless-shell; \ fi \ diff --git a/images/custom/Containerfile b/images/custom/Containerfile index 5f8072f6..084104b3 100644 --- a/images/custom/Containerfile +++ b/images/custom/Containerfile @@ -63,7 +63,7 @@ RUN useradd -ms /bin/bash frappe \ && apt-get install -y ./$downloaded_file \ && rm $downloaded_file \ # Chromium - && if [ "$INSTALL_CHROMIUM" = "true" ]; then \ + && if [ "$INSTALL_CHROMIUM" != "false" ]; then \ DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \ chromium-headless-shell; \ fi \ diff --git a/images/production/Containerfile b/images/production/Containerfile index e2a2f3ee..983dc2ea 100644 --- a/images/production/Containerfile +++ b/images/production/Containerfile @@ -59,7 +59,7 @@ RUN useradd -ms /bin/bash frappe \ && apt-get install -y ./$downloaded_file \ && rm $downloaded_file \ # Chromium - && if [ "$INSTALL_CHROMIUM" = "true" ]; then \ + && if [ "$INSTALL_CHROMIUM" != "false" ]; then \ DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \ chromium-headless-shell; \ fi \