From 37377b07f017dca424ef6b6fb763c9fdea8b50c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Stan=C4=8Der?= Date: Mon, 16 May 2022 20:02:22 +0200 Subject: [PATCH] Add architecture detection for WKHTMLtoX installation If Apple silicon version of Docker Desktop is installed then some containers will be for arm64 architecture instead of amd64. So when installing WKHTMLtoX a proper package has to be installed. --- workspace/Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/workspace/Dockerfile b/workspace/Dockerfile index a67bc20..18640a6 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -1442,7 +1442,8 @@ USER root ARG INSTALL_WKHTMLTOPDF=false RUN if [ ${INSTALL_WKHTMLTOPDF} = true ]; then \ - apt-get install -y \ + ARCH=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) \ + && apt-get install -y \ libxrender1 \ libfontconfig1 \ libx11-dev \ @@ -1453,8 +1454,8 @@ RUN if [ ${INSTALL_WKHTMLTOPDF} = true ]; then \ xfonts-base \ xfonts-75dpi \ wget \ - && wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.bionic_amd64.deb \ - && dpkg -i wkhtmltox_0.12.6-1.bionic_amd64.deb \ + && wget "https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.bionic_${ARCH}.deb" \ + && dpkg -i "wkhtmltox_0.12.6-1.bionic_${ARCH}.deb" \ && apt -f install \ ;fi