From 2e6bc52f6a9db7172604c51b265e500d3f0876f8 Mon Sep 17 00:00:00 2001 From: Guiorgy Date: Sun, 3 Aug 2025 00:40:39 +0400 Subject: [PATCH] docker: Set DEBIAN_FRONTEND only during build From the Dockerfile docs: > Environment variable persistence can cause unexpected side effects. > For example, setting ENV DEBIAN_FRONTEND=noninteractive changes the > behavior of apt-get, and may confuse users of your image. > > If an environment variable is only needed during build, and not in the > final image, consider setting a value for a single command instead. So this patch adjusts the use of the DEBIAN_FRONTEND variable to match the documented best practice. https://github.com/albertito/chasquid/pull/68 Amended-by: Alberto Bertogli Adjusted commit message. --- docker/Dockerfile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 6088808..f0d1eea 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -17,13 +17,12 @@ RUN go get -d ./... && \ # Create the image. FROM debian:stable -# Make debconf/frontend non-interactive, to avoid distracting output about the -# lack of $TERM. -ENV DEBIAN_FRONTEND=noninteractive - # Install the packages we need. # This includes chasquid, which sets up good defaults. -RUN apt-get update -q && \ +# Make debconf/frontend non-interactive, to avoid distracting output about the +# lack of $TERM. +RUN DEBIAN_FRONTEND=noninteractive \ + apt-get update -q && \ apt-get install -y -q \ chasquid \ dovecot-lmtpd dovecot-imapd dovecot-pop3d \