This guide contains information about how to contribute to this collection of dev container Features maintained by Coder.
This repository currently contains the following features:
code-server
- Adds VS Code in the browser functionality to your dev container
To add a new feature to this collection:
- Create a new folder under the
src
directory with the name of your feature - Add a
devcontainer-feature.json
file describing your feature and its options - Create an
install.sh
script that installs the feature - Optionally add a
README.md
with additional documentation
Each feature should follow this structure:
src/
└── your-feature-name/
├── devcontainer-feature.json # Feature metadata and options
├── install.sh # Installation script
└── README.md # (Optional) Feature-specific documentation
{
"name": "Your Feature Name",
"id": "your-feature-name",
"version": "1.0.0",
"description": "Brief description of your feature",
"options": {
"optionId": {
"type": "string",
"default": "default value",
"description": "Description of this option"
}
},
"entrypoint": "/usr/local/bin/your-feature-entrypoint",
"dependsOn": {
"ghcr.io/devcontainers/features/common-utils:2": {}
}
}
Before submitting a PR, test your feature using the Dev Container CLI:
# From the repository root
devcontainer features test -f your-feature-name -i mcr.microsoft.com/devcontainers/base:ubuntu
You can also test all features or test with different base images:
# Test all features
devcontainer features test -a
# Test with a specific base image
devcontainer features test -f your-feature-name -i mcr.microsoft.com/devcontainers/base:debian
You can also test features with specific options:
# Test with custom options
devcontainer features test -f code-server -i mcr.microsoft.com/devcontainers/base:ubuntu --skip-scenarios -t "port=8123"
Follow semantic versioning for all features:
- Increment the major version when making incompatible changes
- Increment the minor version when adding functionality in a backward-compatible manner
- Increment the patch version when making backward-compatible bug fixes
Update the version in your feature's devcontainer-feature.json
file.
Features in this repository are automatically published to GitHub Container Registry (GHCR) via GitHub Actions when changes are merged to the main branch.
The published features will be available at:
ghcr.io/coder/devcontainer-features/feature-id:version
For example, the current code-server feature is referenced as:
ghcr.io/coder/devcontainer-features/code-server:1
After a feature is published to GHCR, make it public by:
- Navigate to the package settings in GHCR:
https://github.com/users/coder/packages/container/devcontainer-features%2Fcode-server/settings
- Change the visibility setting to "Public"
- Fork this repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- Use shellcheck to validate your shell scripts
- Include comments explaining complex operations
- Follow the style of existing features for consistency
If you have questions about contributing to this repository, please open an issue or reach out to the Coder team directly.