microsoft / microsoft/vscode-remote-release

New environment configuration file: /etc/devcontainer

Open
#3,593 27 comments 1 reaction 1 assignee View on GitHub

@chrmarti is already working on this.

Since Aug 31, 2020.

containers feature-request plan-review
Dominant language
Dockerfile
Stars
4.2k
Forks
470
Avg merge
1d 1h
Merged PRs (30d)
1

Description

A new option in devcontainer.json:

{
  "sourceEtcDevcontainer": true // defaults to true
}

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).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.