From 9488a0c838df760d8389e4736f32ec8edadd2f71 Mon Sep 17 00:00:00 2001 From: Benedikt Heine Date: Tue, 9 May 2023 18:24:45 +0200 Subject: [PATCH] Update Dockerfile syntax for best practices - install packages before adding the content. This won't trash the caching layers - Have sorted lists - Use export instead of ARG for DEBIAN_FRONTEND --- Dockerfile | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 98289391..6d327354 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,16 +11,19 @@ LABEL org.label-schema.vendor="Tag1 Consulting" \ ENV GOOSE_EXAMPLE=umami \ GOOSE_FEATURES="gaggle" -ARG DEBIAN_FRONTEND=noninteractive +RUN export DEBIAN_FRONTEND=noninteractive \ + && apt-get update \ + && apt-get install -y \ + cmake \ + gcc \ + libssl-dev \ + pkg-config \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* COPY . /build WORKDIR ./build -RUN apt-get update && \ - apt-get install -y libssl-dev gcc pkg-config cmake && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* - RUN cargo build --features "${GOOSE_FEATURES}" --release --example "${GOOSE_EXAMPLE}" RUN chmod +x ./docker-entrypoint.sh