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 20:02:22 +02:00 committed by GitHub
parent 4b81ddf797
commit 37377b07f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1442,7 +1442,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 -y \ ARCH=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) \
&& apt-get install -y \
libxrender1 \ libxrender1 \
libfontconfig1 \ libfontconfig1 \
libx11-dev \ libx11-dev \
@ -1453,8 +1454,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.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_amd64.deb \ && dpkg -i "wkhtmltox_0.12.6-1.bionic_${ARCH}.deb" \
&& apt -f install \ && apt -f install \
;fi ;fi