Skip to content

Commit

Permalink
fix(Dockerfile): Downgrade to Debian 11
Browse files Browse the repository at this point in the history
- To fix Mumble 1.4.287 build
- Allow choosing debian version with ARGs
  • Loading branch information
maweil committed Jan 23, 2024
1 parent c3b0043 commit 9696c56
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 \
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion copy-libs.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/bash
#!/bin/sh
if [ $# -lt 2 ]
then
echo "Too few arguments. Run copy-libs.sh <binary or shared lib to analyze> <target directory>"
Expand Down

0 comments on commit 9696c56

Please sign in to comment.