From 2b6d21572e39ded7488f1e592a08192dfa458c06 Mon Sep 17 00:00:00 2001 From: Peter Dave Hello Date: Sun, 7 Apr 2024 01:32:37 +0800 Subject: [PATCH] Optimize apt-get commands to reduce image size in Dockerfile This commit improves the Dockerfile by consolidating apt-get update and apt-get install commands into a single RUN statement and adding cleanup steps for the apt cache. --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 59ad657..b8087a9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,8 +15,9 @@ COPY . . RUN cargo build --release FROM debian:11-slim -RUN apt-get update -RUN apt-get install dumb-init -y +RUN apt-get update \ + && apt-get install dumb-init -y \ + && rm -rf /var/lib/apt/lists/* COPY --from=cargo-build /usr/src/onetun/target/release/onetun /usr/local/bin/onetun