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 <murukesh.mohanan@gmail.com>
(cherry picked from commit 7227c0145d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Murukesh Mohanan 2022-06-20 18:33:57 +09:00 committed by Sebastiaan van Stijn
parent 0b421dc050
commit 0c8ce43ccc
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
1 changed files with 1 additions and 1 deletions

View File

@ -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: image, consider setting a value for a single command instead:
```dockerfile ```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: Or using [`ARG`](#arg), which is not persisted in the final image: