From 0ee5e0a48a5d03464cbab750c0f4b727c89474e4 Mon Sep 17 00:00:00 2001 From: Son Date: Tue, 27 Feb 2024 06:14:15 -0500 Subject: [PATCH] Fix apt conflict builds --- bookworm/Dockerfile | 34 ++++++++++++++++++++-------------- bullseye/Dockerfile | 34 ++++++++++++++++++++-------------- 2 files changed, 40 insertions(+), 28 deletions(-) diff --git a/bookworm/Dockerfile b/bookworm/Dockerfile index 601c016..2617c09 100644 --- a/bookworm/Dockerfile +++ b/bookworm/Dockerfile @@ -1,3 +1,20 @@ +FROM arm64v8/debian:bookworm-slim as qemu_build + +ENV DEBIAN_FRONTEND noninteractive + +# Set SHELL option explicitly +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +# hadolint ignore=DL3008 +RUN set -x \ + # Install, update & upgrade packages + && dpkg --add-architecture i386 \ + && apt-get update \ + && apt-get install -y --no-install-recommends --no-install-suggests \ + libc6:i386=2.36-9+deb12u4 \ + qemu-user-static=1:7.2+dfsg-7+deb12u5 \ + && rm -rf /var/lib/apt/lists/* + ############################################################ # Dockerfile that contains SteamCMD and Box86/64 ############################################################ @@ -18,6 +35,8 @@ ENV DEBUGGER "/usr/local/bin/box86" # Set SHELL option explicitly SHELL ["/bin/bash", "-o", "pipefail", "-c"] +COPY --from=qemu_build /usr/bin/qemu-i386-static /usr/bin/qemu-i386-static + # hadolint ignore=DL3008 RUN set -x \ # Install, update & upgrade packages @@ -34,27 +53,14 @@ RUN set -x \ locales=2.36-9+deb12u4 \ wget=1.21.3-1+b1 \ gnupg=2.2.40-1.1 \ - qemu-user-static=1:7.2+dfsg-7+deb12u5 \ - && apt-mark hold qemu-user-static \ - && for file in /usr/bin/qemu-*-static /usr/lib/binfmt.d/qemu-* /usr/libexec/qemu-binfmt/* /usr/sbin/qemu-* /usr/share/binfmts/qemu-* /usr/share/doc/qemu-user-static/* /usr/share/lintian/overrides/qemu-user-static /usr/share/man/man1/qemu-*; do \ - case "$file" in \ - "/usr/bin/qemu-i386-static" | \ - "/usr/share/man/man1/qemu-i386-static.1.gz") \ - continue;; \ - *) \ - rm -f "$file";; \ - esac; \ - done \ && wget --progress=dot:giga https://ryanfortner.github.io/box64-debs/box64.list -O /etc/apt/sources.list.d/box64.list \ && (wget -qO- https://ryanfortner.github.io/box64-debs/KEY.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg) \ && wget --progress=dot:giga https://itai-nelken.github.io/weekly-box86-debs/debian/box86.list -O /etc/apt/sources.list.d/box86.list \ && (wget -qO- https://itai-nelken.github.io/weekly-box86-debs/debian/KEY.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/box86-debs-archive-keyring.gpg) \ && apt-get update \ - && apt-get download -y \ + && apt-get install -y --no-install-recommends --no-install-suggests \ box64-arm64 \ box86 \ - && dpkg --force-all -i ./*.deb \ - && rm -rf ./*.deb \ && sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \ && dpkg-reconfigure --frontend=noninteractive locales \ # Create unprivileged user diff --git a/bullseye/Dockerfile b/bullseye/Dockerfile index e9d7c47..7ddab53 100644 --- a/bullseye/Dockerfile +++ b/bullseye/Dockerfile @@ -1,3 +1,20 @@ +FROM arm64v8/debian:bookworm-slim as qemu_build + +ENV DEBIAN_FRONTEND noninteractive + +# Set SHELL option explicitly +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +# hadolint ignore=DL3008 +RUN set -x \ + # Install, update & upgrade packages + && dpkg --add-architecture i386 \ + && apt-get update \ + && apt-get install -y --no-install-recommends --no-install-suggests \ + libc6:i386=2.36-9+deb12u4 \ + qemu-user-static=1:5.2+dfsg-11+deb11u3 \ + && rm -rf /var/lib/apt/lists/* + ############################################################ # Dockerfile that contains SteamCMD and Box86/64 ############################################################ @@ -18,6 +35,8 @@ ENV DEBUGGER "/usr/local/bin/box86" # Set SHELL option explicitly SHELL ["/bin/bash", "-o", "pipefail", "-c"] +COPY --from=qemu_build /usr/bin/qemu-i386-static /usr/bin/qemu-i386-static + # hadolint ignore=DL3008 RUN set -x \ # Install, update & upgrade packages @@ -34,27 +53,14 @@ RUN set -x \ locales=2.31-13+deb11u7 \ wget=1.21-1+deb11u1 \ gnupg=2.2.27-2+deb11u2 \ - qemu-user-static=1:5.2+dfsg-11+deb11u3 \ - && apt-mark hold qemu-user-static \ - && for file in /usr/bin/qemu-*-static /usr/lib/binfmt.d/qemu-* /usr/libexec/qemu-binfmt/* /usr/sbin/qemu-* /usr/share/binfmts/qemu-* /usr/share/doc/qemu-user-static/* /usr/share/lintian/overrides/qemu-user-static /usr/share/man/man1/qemu-*; do \ - case "$file" in \ - "/usr/bin/qemu-i386-static" | \ - "/usr/share/man/man1/qemu-i386-static.1.gz") \ - continue;; \ - *) \ - rm -f "$file";; \ - esac; \ - done \ && wget --progress=dot:giga https://ryanfortner.github.io/box64-debs/box64.list -O /etc/apt/sources.list.d/box64.list \ && (wget -qO- https://ryanfortner.github.io/box64-debs/KEY.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg) \ && wget --progress=dot:giga https://itai-nelken.github.io/weekly-box86-debs/debian/box86.list -O /etc/apt/sources.list.d/box86.list \ && (wget -qO- https://itai-nelken.github.io/weekly-box86-debs/debian/KEY.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/box86-debs-archive-keyring.gpg) \ && apt-get update \ - && apt-get download -y \ + && apt-get install -y --no-install-recommends --no-install-suggests \ box64-arm64 \ box86 \ - && dpkg --force-all -i ./*.deb \ - && rm -rf ./*.deb \ && sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \ && dpkg-reconfigure --frontend=noninteractive locales \ # Create unprivileged user