The ENV
instruction has, for the most part, unexpected side effects:
"The environment variables set using ENV
will persist when a container
is run from the resulting image." This is rarely needed and may cause
problems in the BIND 9 CI. ARG
instruction does not have this side
effect and perishes with the build environment.
I checked the BIND 9 repository, and no former ENV
variable is required there.
BIND 9 validation run with staging images: https://gitlab.isc.org/isc-projects/bind9/-/pipelines/132178
Alpine Linux 3.17 container:
Before:
/ # env
HOSTNAME=8192f20fcc2b
SHLVL=1
HOME=/root
KYUA_GIT_COMMIT=2fc3c21c30f9c52efaacb73f6f8b8dc716cf4bc2
TERM=xterm
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
JEMALLOC_VERSION=5.3.0
PWD=/
After (KYUA_GIT_COMMIT
and JEMALLOC_VERSION
are not present anymore):
HOSTNAME=a2f72333fc40
SHLVL=1
HOME=/root
TERM=xterm
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PWD=/