Browse Source

apply path also when sudoing

otherwise the "secure-path" will override our carefully created path-variable

Changelog: Use same environment '$PATH' variable when using sudo

Signed-off-by: Simon Gamma <github@survive.ch>
1.2.x
Simon Gamma 6 years ago
parent
commit
d202b218c4
  1. 4
      Dockerfile

4
Dockerfile

@ -81,6 +81,10 @@ RUN env CGO_ENABLED=1 \
GOOS=linux \
GOARM=6 GOARCH=arm make build
# allow us to keep original PATH variables when sudoing
RUN echo "Defaults secure_path=\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:$PATH\"" > /etc/sudoers.d/secure_path_override
RUN chmod 0440 /etc/sudoers.d/secure_path_override
WORKDIR /
COPY docker-entrypoint.sh /usr/local/bin/

Loading…
Cancel
Save