[FIX] Odoo 16.0: use dpkg to find build architecture

As the docker-library doesn't use TARGETARCH yet, this commit set that
variable by using `dpk --print-architecture` when the variable is not set.
This commit is contained in:
Christophe Monniez 2023-10-26 11:05:05 +02:00
parent 8a93c61c02
commit 9b5e2cf27b

View File

@ -36,9 +36,12 @@ RUN apt-get update && \
python3-xlrd \ python3-xlrd \
python3-xlwt \ python3-xlwt \
xz-utils && \ xz-utils && \
if [ -z "${TARGETARCH}" ]; then \
TARGETARCH="$(dpkg --print-architecture)"; \
fi; \
WKHTMLTOPDF_ARCH=${TARGETARCH} && \ WKHTMLTOPDF_ARCH=${TARGETARCH} && \
case ${TARGETARCH} in \ case ${TARGETARCH} in \
"amd64" | "") WKHTMLTOPDF_ARCH=amd64 && WKHTMLTOPDF_SHA=9df8dd7b1e99782f1cfa19aca665969bbd9cc159 ;; \ "amd64") WKHTMLTOPDF_ARCH=amd64 && WKHTMLTOPDF_SHA=9df8dd7b1e99782f1cfa19aca665969bbd9cc159 ;; \
"arm64") WKHTMLTOPDF_SHA=58c84db46b11ba0e14abb77a32324b1c257f1f22 ;; \ "arm64") WKHTMLTOPDF_SHA=58c84db46b11ba0e14abb77a32324b1c257f1f22 ;; \
"ppc64le") WKHTMLTOPDF_ARCH=ppc64el && WKHTMLTOPDF_SHA=7ed8f6dcedf5345a3dd4eeb58dc89704d862f9cd ;; \ "ppc64le") WKHTMLTOPDF_ARCH=ppc64el && WKHTMLTOPDF_SHA=7ed8f6dcedf5345a3dd4eeb58dc89704d862f9cd ;; \
esac \ esac \