From 7227c0145d94db0c9322ff0de1fb803042856f5d Mon Sep 17 00:00:00 2001 From: Murukesh Mohanan Date: Mon, 20 Jun 2022 18:33:57 +0900 Subject: [PATCH] docs: fix misleading example of setting an env variable for a single command The `DEBIAN_FRONTEND` environment variable is used to control the interface by which debconf questions are presented to the user (see [`man 7 debconf`][1]). In `DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y`, the `DEBIAN_FRONTEND` environment variable is only set for the `apt-get update` command which does not ask debconf questions, and will not affect the `apt-get install` command where these questions are actually asked. It should be the other way around. [1]: https://manpages.debian.org/debconf.7.html Signed-off-by: Murukesh Mohanan --- docs/reference/builder.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/builder.md b/docs/reference/builder.md index 125fd1b53c..f8f4be32d1 100644 --- a/docs/reference/builder.md +++ b/docs/reference/builder.md @@ -1060,7 +1060,7 @@ If an environment variable is only needed during build, and not in the final image, consider setting a value for a single command instead: ```dockerfile -RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y ... +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y ... ``` Or using [`ARG`](#arg), which is not persisted in the final image: