From 4b81ddf79709cbf75bddb1a189d4807c6563f082 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Stan=C4=8Der?= Date: Mon, 16 May 2022 19:57:46 +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. --- php-fpm/Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index 57578ebf..d34469e7 100644 --- a/php-fpm/Dockerfile +++ b/php-fpm/Dockerfile @@ -1038,7 +1038,8 @@ USER root ARG INSTALL_WKHTMLTOPDF=false RUN if [ ${INSTALL_WKHTMLTOPDF} = true ]; then \ - apt-get install -yqq \ + ARCH=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) \ + && apt-get install -yqq \ libxrender1 \ libfontconfig1 \ libx11-dev \ @@ -1049,8 +1050,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.stretch_amd64.deb \ - && dpkg -i wkhtmltox_0.12.6-1.stretch_amd64.deb \ + && wget "https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.stretch_${ARCH}.deb" \ + && dpkg -i "wkhtmltox_0.12.6-1.stretch_${ARCH}.deb" \ && apt -f install \ ;fi