Added `DEBIAN_FRONTEND=noninteractive` to `sudo` (#1859)
By default `sudo` drops all environment variables and executes its commands with a clean environment. This is by design, but for the `DEBIAN_FRONTEND` environment variable it is not what we want, since it results in installers being interactive. This adds the `env_keep` instruction to `/etc/sudoers` to keep `DEBIAN_FRONTEND` with its `noninteractive` value, and thus pass it on to commands that care about it. Note that this makes no difference in our builds, because we are running them directly as `root`. However, for users of our image this is going to make a difference, since they start out as `runner` and have to use `sudo`. Co-authored-by: Fleshgrinder <fleshgrinder@users.noreply.github.com>
This commit is contained in:
parent
3b36a81db6
commit
61d1235d2a
|
|
@ -54,7 +54,8 @@ RUN adduser --disabled-password --gecos "" --uid 1000 runner \
|
|||
&& groupadd docker \
|
||||
&& usermod -aG sudo runner \
|
||||
&& usermod -aG docker runner \
|
||||
&& echo "%sudo ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers
|
||||
&& echo "%sudo ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers \
|
||||
&& echo "Defaults env_keep += \"DEBIAN_FRONTEND\"" >> /etc/sudoers
|
||||
|
||||
# arch command on OS X reports "i386" for Intel CPUs regardless of bitness
|
||||
# Docker download supports arm64 as aarch64 & amd64 / i386 as x86_64
|
||||
|
|
|
|||
|
|
@ -66,7 +66,8 @@ RUN set -vx; \
|
|||
&& groupadd docker \
|
||||
&& usermod -aG sudo runner \
|
||||
&& usermod -aG docker runner \
|
||||
&& echo "%sudo ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers
|
||||
&& echo "%sudo ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers \
|
||||
&& echo "Defaults env_keep += \"DEBIAN_FRONTEND\"" >> /etc/sudoers
|
||||
|
||||
# Uncomment the below COPY to use your own custom build of actions-runner.
|
||||
#
|
||||
|
|
|
|||
Loading…
Reference in New Issue