vscode-dev-containers icon indicating copy to clipboard operation
vscode-dev-containers copied to clipboard

expose more argument to feature option from the script-library

Open tczhao opened this issue 3 years ago • 1 comments

I wonder if we can expose more Arguments to Feature option?

For example, for go-install script, we would like to configure GOPATH due to some code generation requirements. We understand we can do it through bash script-library, but it would be much cleaner to configure it through the feature option instead (devcontainer.json )

Argument Feature option Default Description
Go version version latest Version of Go to install. Use latest to install the latest released version. Partial version numbers are accepted (e.g. 1.17).
GOROOT /usr/local/go Location to install Go.
GOPATH /go Location to use as the GOPATH. Tools are installed under ${GOPATH}/bin
Non-root user automatic Specifies a user in the container other than root. A value of automatic will cause the script to check for a user called vscode, then node, codespace, and finally a user with a UID of 1000 before falling back to root.
Add to rc files flag true A true/false flag that indicates whether the PATH should be updated and GOPATH and GOROOT set via /etc/bash.bashrc and /etc/zsh/zshrc.
Install tools flag true A true/false flag that indicates whether to install common Go utilities.
"features": {
    "golang": "latest"
}
"features": {
    "golang": "latest"
}

Relates to: Codespaces && Remote - Containers

tczhao avatar May 13 '22 02:05 tczhao

Definitely! We would accept a PR of any options you find particularly useful. I'd say ideally, all of the options possible to be passed to go-debian.sh should be surfaced as 'feature' options.

The changes would need to be done in the devcontainer-features.json and piped through to the install script following the pattern here.

docker-in-docker is an example of a feature with > 1 option.

joshspicer avatar May 15 '22 23:05 joshspicer