From 47085a661cb51ae27ec122a70ddcb1ee1ab2eaeb Mon Sep 17 00:00:00 2001 From: Marco Cadetg Date: Sun, 23 Feb 2025 10:05:15 +0100 Subject: [PATCH] remove unnecessary libraries from docker image --- Dockerfile | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/Dockerfile b/Dockerfile index d99043c7..ad96da93 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM rust:1.85-slim AS builder -# Install sniffnet build dependencies +# Install build dependencies for both X11 and Wayland RUN apt-get update && apt-get install -y \ libfreetype6-dev \ libexpat1-dev \ @@ -11,17 +11,15 @@ RUN apt-get update && apt-get install -y \ pkg-config \ && rm -rf /var/lib/apt/lists/* -# Create a new empty shell project WORKDIR /usr/src/sniffnet COPY . . -# Build for release RUN cargo build --release # Runtime stage FROM debian:bookworm-slim -# Install runtime dependencies including Wayland +# Install runtime dependencies for both X11 and Wayland RUN apt-get update && apt-get install -y \ libfreetype6 \ libexpat1 \ @@ -29,21 +27,8 @@ RUN apt-get update && apt-get install -y \ libasound2 \ libfontconfig1 \ libgtk-3-0 \ - libwayland-client0 \ - libwayland-cursor0 \ - libwayland-egl1 \ - libxkbcommon0 \ - mesa-utils \ - libegl1 \ - libvulkan1 \ && rm -rf /var/lib/apt/lists/* -# Copy the built binary COPY --from=builder /usr/src/sniffnet/target/release/sniffnet /usr/local/bin/sniffnet -# Set environment variables for Wayland -ENV GDK_BACKEND=wayland -ENV WAYLAND_DISPLAY=$WAYLAND_DISPLAY -ENV XDG_RUNTIME_DIR=/tmp - -ENTRYPOINT ["sniffnet"] \ No newline at end of file +ENTRYPOINT ["sniffnet"]