Skip to content
Permalink
Browse files

configure proxy settings on all processes under systemd

  • Loading branch information...
BenTheElder committed Jul 8, 2019
1 parent 99d8720 commit 022110dc94ba406da0629a4351efd89aebc2b722
Showing with 11 additions and 0 deletions.
  1. +11 −0 images/base/entrypoint
@@ -80,11 +80,22 @@ fix_kmsg() {
fi
}

configure_proxy() {
# ensure all processes receive the proxy settings by default
# https://www.freedesktop.org/software/systemd/man/systemd-system.conf.html
mkdir -p /etc/systemd/system.conf.d/
cat <<EOF >/etc/systemd/system.conf.d/proxy-default-environment.conf
[Manager]
DefaultEnvironment="HTTP_PROXY=${HTTP_PROXY:-}" "HTTPS_PROXY=${HTTPS_PROXY:-}" "NO_PROXY=${NO_PROXY:-}"
EOF
}

# run pre-init fixups
fix_kmsg
fix_mount
fix_machine_id
fix_product_name
configure_proxy

# we want the command (expected to be systemd) to be PID1, so exec to it
exec "$@"

0 comments on commit 022110d

Please sign in to comment.
You can’t perform that action at this time.