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.
This commit is contained in:
Denis Stančer 2022-05-16 19:57:46 +02:00 committed by GitHub
parent a2dd97674f
commit 4b81ddf797
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1038,7 +1038,8 @@ USER root
ARG INSTALL_WKHTMLTOPDF=false ARG INSTALL_WKHTMLTOPDF=false
RUN if [ ${INSTALL_WKHTMLTOPDF} = true ]; then \ 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 \ libxrender1 \
libfontconfig1 \ libfontconfig1 \
libx11-dev \ libx11-dev \
@ -1049,8 +1050,8 @@ RUN if [ ${INSTALL_WKHTMLTOPDF} = true ]; then \
xfonts-base \ xfonts-base \
xfonts-75dpi \ xfonts-75dpi \
wget \ wget \
&& wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/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_amd64.deb \ && dpkg -i "wkhtmltox_0.12.6-1.stretch_${ARCH}.deb" \
&& apt -f install \ && apt -f install \
;fi ;fi