I have a rather complex setup (corporate proxy) where I need to set proxies in the vscode remote container in order to do anything.
This works great if I set HTTP_PROXY
and such in the containerEnv
in devcontainer.json
.
Now in case someone wants to temporarily add a tool via apt
, one needs to use sudo
in order to use apt
. But the root
user does not contain any of the environment variables passed in containerEnv
or remoteEnv
or even via runArgs
.
This can be verified by running sudo env
in the container which does not list any of the variables I set.
How can I set environment variables for the root user in the devcontainer.json
file?