Description
A new option in devcontainer.json
:
This option makes the Remote - Containers extension always execute commands in the container using the following syntax:
$ docker exec ubuntu sh -c "test -f /etc/devcontainer && . /etc/devcontainer; echo 'hello world'"
Unless the user sets it to false
.
This will not interfere in userEnvProbe
behavior.
The /etc/devcontainer
file must be a shell script compatible with Bourne Shell /bin/sh
.
This would enable us to have a clean and unique environment configuration file that would work across all the users (root
and non-root), and all the shells, without the caveats of /etc/profile
or bash.bashrc
.
So global environment variables can be set using scripts and not only through the Dockerfile
's ENV
statement, or the devcontainer.json
's containerEnv
, thus making the installation scripts easier to use since they would not require the user to manually inject some statements in the Dockerfile
.
This would mainly benefit the scripts from script-library
on vscode-dev-containers
repository, which are used for doing common customizations on the containers. As explained here (bullet number 2).