Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test: User env variables for dev container features #7404

Closed
2 tasks done
chrmarti opened this issue Oct 24, 2022 · 2 comments
Closed
2 tasks done

Test: User env variables for dev container features #7404

chrmarti opened this issue Oct 24, 2022 · 2 comments
Labels
containers Issue in vscode-remote containers testplan-item
Milestone

Comments

@chrmarti
Copy link
Contributor

chrmarti commented Oct 24, 2022

Refs: devcontainers/spec#91

Complexity: 4

Create Issue


  • Requires Dev Containers extension 0.261.0.
  • Have a workspace folder with the following 3 files:
  • .devcontainer/devcontainer.json:
{
	"image": "mcr.microsoft.com/devcontainers/base:0-focal",
	"features": {
		"./test-feature": "latest"
	}
}
  • .devcontainer/test-feature/devcontainer-feature.json:
{
	"id": "test-feature"
}
  • .devcontainer/test-feature/install.sh:
#!/bin/sh

printenv >/printenv.env
  • Reopen this folder in a dev container and verify that /printenv.env has _REMOTE_USER, _CONTAINER_USER, _REMOTE_USER_HOME and _CONTAINER_USER_HOME.
  • Add the following to the devcontainer.json:
	"containerUser": "vscode",
	"remoteUser": "root",
  • Rebuild the container and verify that /printenv.env has the updated values.
@chrmarti chrmarti added containers Issue in vscode-remote containers testplan-item labels Oct 24, 2022
@chrmarti chrmarti added this to the October 2022 milestone Oct 24, 2022
@ghost ghost assigned eleanorjboyd and weinand Oct 25, 2022
@weinand
Copy link

weinand commented Oct 25, 2022

works fine for me on macOS and a Docker container.

@weinand weinand removed their assignment Oct 25, 2022
@eleanorjboyd eleanorjboyd removed their assignment Oct 25, 2022
@eleanorjboyd
Copy link
Member

works as well for me, macOS and Docker container

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
containers Issue in vscode-remote containers testplan-item
Projects
None yet
Development

No branches or pull requests

3 participants