From 9696c56de02eb0ca53913c1b4b03956a86b3bb59 Mon Sep 17 00:00:00 2001 From: Maximilian Weiler <16721506+maweil@users.noreply.github.com> Date: Tue, 23 Jan 2024 21:18:40 +0100 Subject: [PATCH] fix(Dockerfile): Downgrade to Debian 11 - To fix Mumble 1.4.287 build - Allow choosing debian version with ARGs --- Dockerfile | 15 +++++++++------ copy-libs.sh | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7f235be..a294251 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,10 @@ +ARG DEBIAN_RELEASE_NAME=bullseye +ARG DEBIAN_RELEASE_NUM=11 + # ------------------------------------------------------# # --- Build stage for the entrypoint.sh replacement ----# # ------------------------------------------------------# -FROM rust:slim-bookworm as builder +FROM rust:slim-${DEBIAN_RELEASE_NAME} as builder WORKDIR /data COPY Cargo.toml /data COPY Cargo.lock /data @@ -15,7 +18,7 @@ RUN cargo build --release # --- Runtime image with mumble-server's dependencies --# # --- (Used to extract the shared libs from later) -----# # ------------------------------------------------------# -FROM debian:bookworm-slim as base +FROM debian:${DEBIAN_RELEASE_NAME}-slim as base ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install --no-install-recommends -y \ @@ -105,15 +108,15 @@ COPY --from=builder /data/target/release/mumble-docker/ /mumble-docker-entrypoin # reuse them in the distroless container in the final stage RUN /copy-libs.sh /mumble-docker-entrypoint /lib/copy RUN /copy-libs.sh /usr/bin/mumble-server /lib/copy -RUN /copy-libs.sh /lib/x86_64-linux-gnu/qt5/plugins/sqldrivers/libqsqlite.so /lib/copy -RUN cp -r /lib/x86_64-linux-gnu/qt-default /lib/copy -RUN cp -r /lib/x86_64-linux-gnu/qt5/ /lib/copy +RUN /copy-libs.sh /usr/lib/x86_64-linux-gnu/qt5/plugins/sqldrivers/libqsqlite.so /lib/copy +RUN cp -r /usr/lib/x86_64-linux-gnu/qt-default /lib/copy +RUN cp -r /usr/lib/x86_64-linux-gnu/qt5/ /lib/copy # ------------------------------------------------------# # --- Distroless base image for the final container --- # # --- Copying over needed libs from previous stage ---- # # ------------------------------------------------------# -FROM gcr.io/distroless/cc-debian12:latest +FROM gcr.io/distroless/cc-debian${DEBIAN_RELEASE_NUM}:latest COPY --from=runner /etc/passwd /etc/passwd COPY --from=runner /etc/shadow /etc/shadow COPY --from=runner /usr/bin/mumble-server /usr/bin/mumble-server diff --git a/copy-libs.sh b/copy-libs.sh index ff1f5e0..987ed31 100755 --- a/copy-libs.sh +++ b/copy-libs.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/bin/sh if [ $# -lt 2 ] then echo "Too few arguments. Run copy-libs.sh "