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 1/3] 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 57578eb..d34469e 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 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 2/3] 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 From b50d514c6c040e4e0848caee8eb41f2e338fdad9 Mon Sep 17 00:00:00 2001 From: Denis Stancer Date: Mon, 16 May 2022 21:36:20 +0200 Subject: [PATCH 3/3] Make WKHTMLtoX version configurable --- .env.example | 2 ++ docker-compose.yml | 2 ++ php-fpm/Dockerfile | 5 +++-- workspace/Dockerfile | 5 +++-- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.env.example b/.env.example index 3adafe9..0368b28 100644 --- a/.env.example +++ b/.env.example @@ -185,6 +185,7 @@ WORKSPACE_SSH_PORT=2222 WORKSPACE_INSTALL_FFMPEG=false WORKSPACE_INSTALL_AUDIOWAVEFORM=false WORKSPACE_INSTALL_WKHTMLTOPDF=false +WORKSPACE_WKHTMLTOPDF_VERSION=0.12.6-1 WORKSPACE_INSTALL_GNU_PARALLEL=false WORKSPACE_INSTALL_AST=true WORKSPACE_AST_VERSION=1.0.10 @@ -263,6 +264,7 @@ PHP_FPM_INSTALL_PING=false PHP_FPM_INSTALL_SSHPASS=false PHP_FPM_INSTALL_MAILPARSE=false PHP_FPM_INSTALL_WKHTMLTOPDF=false +PHP_FPM_KHTMLTOPDF_VERSION=0.12.6-1 PHP_FPM_INSTALL_XLSWRITER=false PHP_FPM_INSTALL_PHPDECIMAL=false PHP_FPM_INSTALL_ZOOKEEPER=false diff --git a/docker-compose.yml b/docker-compose.yml index 70cef48..6313685 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -162,6 +162,7 @@ services: - INSTALL_FFMPEG=${WORKSPACE_INSTALL_FFMPEG} - INSTALL_AUDIOWAVEFORM=${WORKSPACE_INSTALL_AUDIOWAVEFORM} - INSTALL_WKHTMLTOPDF=${WORKSPACE_INSTALL_WKHTMLTOPDF} + - WKHTMLTOPDF_VERSION=${WORKSPACE_WKHTMLTOPDF_VERSION} - INSTALL_GNU_PARALLEL=${WORKSPACE_INSTALL_GNU_PARALLEL} - INSTALL_LNAV=${WORKSPACE_INSTALL_LNAV} - INSTALL_PROTOC=${WORKSPACE_INSTALL_PROTOC} @@ -268,6 +269,7 @@ services: - INSTALL_FFMPEG=${PHP_FPM_FFMPEG} - INSTALL_AUDIOWAVEFORM=${PHP_FPM_AUDIOWAVEFORM} - INSTALL_WKHTMLTOPDF=${PHP_FPM_INSTALL_WKHTMLTOPDF} + - WKHTMLTOPDF_VERSION=${WORKSPACE_WKHTMLTOPDF_VERSION} - INSTALL_XHPROF=${PHP_FPM_INSTALL_XHPROF} - INSTALL_XMLRPC=${PHP_FPM_INSTALL_XMLRPC} - INSTALL_PHPDECIMAL=${PHP_FPM_INSTALL_PHPDECIMAL} diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index d34469e..3fe1945 100644 --- a/php-fpm/Dockerfile +++ b/php-fpm/Dockerfile @@ -1036,6 +1036,7 @@ RUN if [ ${INSTALL_AUDIOWAVEFORM} = true ]; then \ USER root ARG INSTALL_WKHTMLTOPDF=false +ARG WKHTMLTOPDF_VERSION=0.12.6-1 RUN if [ ${INSTALL_WKHTMLTOPDF} = true ]; then \ ARCH=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) \ @@ -1050,8 +1051,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_${ARCH}.deb" \ - && dpkg -i "wkhtmltox_0.12.6-1.stretch_${ARCH}.deb" \ + && wget "https://github.com/wkhtmltopdf/packaging/releases/download/${WKHTMLTOPDF_VERSION}/wkhtmltox_0.12.6-1.stretch_${ARCH}.deb" \ + && dpkg -i "wkhtmltox_${WKHTMLTOPDF_VERSION}.stretch_${ARCH}.deb" \ && apt -f install \ ;fi diff --git a/workspace/Dockerfile b/workspace/Dockerfile index 18640a6..9aba709 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -1440,6 +1440,7 @@ RUN if [ ${INSTALL_AUDIOWAVEFORM} = true ]; then \ USER root ARG INSTALL_WKHTMLTOPDF=false +ARG WKHTMLTOPDF_VERSION=0.12.6-1 RUN if [ ${INSTALL_WKHTMLTOPDF} = true ]; then \ ARCH=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) \ @@ -1454,8 +1455,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_${ARCH}.deb" \ - && dpkg -i "wkhtmltox_0.12.6-1.bionic_${ARCH}.deb" \ + && wget "https://github.com/wkhtmltopdf/packaging/releases/download/${WKHTMLTOPDF_VERSION}/wkhtmltox_0.12.6-1.bionic_${ARCH}.deb" \ + && dpkg -i "wkhtmltox_${WKHTMLTOPDF_VERSION}.bionic_${ARCH}.deb" \ && apt -f install \ ;fi