npx degit 46ki75/template-devcontainerCreate a directory at .devcontainer/features/<YOUR_FEATURE_NAME> containing following files:
devcontainer-feature.json: Metadata describing the feature.install.sh: Shell script to install the feature.
id: Identifier for this feature.installAfter: Specifies dependencies that must be installed before this feature.customizations.vscode: VSCode settings and extensions to apply when this features is used.
{
"id": "cargo-binstall",
"name": "cargo-binstall (via cargo)",
"version": "1.0.0",
"customizations": {
"vscode": {
"settings": {
"[rust]": { "editor.defaultFormatter": "rust-lang.rust-analyzer" }
},
"extensions": ["rust-lang.rust-analyzer"]
}
},
"installsAfter": ["ghcr.io/devcontainers/features/rust"]
}Dev Container features are defined using simple shell scripts.
#!/bin/bash
set -e -u -o pipefail
USERNAME="${USERNAME:-"vscode"}"
su "${USERNAME}" -c "curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash"
su "${USERNAME}" -c "cargo binstall just cargo-lambda --no-confirm"
echo "Done!"
# Add your custom installation steps below ---Exploring the actual implementations in Available Dev Container Features is the best way to learn how to create your own.
For detailed specifications, see the Dev Container metadata reference.