build: simplify detection of the target platform

It can be done within the container, rather than having to compute it in
the Makefile and then pass it as an argument.
This commit is contained in:
Saúl Ibarra Corretgé
2024-01-15 11:48:36 +01:00
parent 21f04ead6e
commit d31e164656
4 changed files with 15 additions and 32 deletions

View File

@@ -1,18 +1,16 @@
FROM docker.io/library/debian:bullseye-slim
ARG JITSI_RELEASE=stable
ARG TARGETPLATFORM
ENV S6_BEHAVIOUR_IF_STAGE2_FAILS=2
COPY rootfs /
RUN case ${TARGETPLATFORM} in \
"linux/amd64") TPL_ARCH=amd64 ;; \
"linux/arm64") TPL_ARCH=arm64 ;; \
esac && \
case ${TARGETPLATFORM} in \
"linux/amd64") S6_ARCH=amd64 ;; \
"linux/arm64") S6_ARCH=aarch64 ;; \
RUN \
dpkgArch="$(dpkg --print-architecture)" && \
case "${dpkgArch##*-}" in \
"amd64") TPL_ARCH=amd64; S6_ARCH=amd64 ;; \
"arm64") TPL_ARCH=arm64; S6_ARCH=aarch64 ;; \
*) echo "unsupported architecture"; exit 1 ;; \
esac && \
apt-dpkg-wrap apt-get update && \
apt-dpkg-wrap apt-get install -y apt-transport-https apt-utils ca-certificates gnupg wget && \