{"id":22979962,"url":"https://github.com/bitwizeshift/devcontainer-features","last_synced_at":"2025-06-16T09:08:33.289Z","repository":{"id":264985597,"uuid":"808354389","full_name":"bitwizeshift/devcontainer-features","owner":"bitwizeshift","description":"A collection of custom devcontainer features","archived":false,"fork":false,"pushed_at":"2024-05-30T22:37:29.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-09T03:40:26.292Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bitwizeshift.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-30T22:37:27.000Z","updated_at":"2024-07-10T12:05:23.000Z","dependencies_parsed_at":"2024-11-27T06:31:13.988Z","dependency_job_id":null,"html_url":"https://github.com/bitwizeshift/devcontainer-features","commit_stats":null,"previous_names":["bitwizeshift/devcontainer-features"],"tags_count":0,"template":false,"template_full_name":"devcontainers/feature-starter","purl":"pkg:github/bitwizeshift/devcontainer-features","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitwizeshift%2Fdevcontainer-features","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitwizeshift%2Fdevcontainer-features/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitwizeshift%2Fdevcontainer-features/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitwizeshift%2Fdevcontainer-features/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitwizeshift","download_url":"https://codeload.github.com/bitwizeshift/devcontainer-features/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitwizeshift%2Fdevcontainer-features/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260131537,"owners_count":22963448,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-15T01:36:09.286Z","updated_at":"2025-06-16T09:08:33.225Z","avatar_url":"https://github.com/bitwizeshift.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dev Container Features: Self Authoring Template\n\n\u003e This repo provides a starting point and example for creating your own custom [dev container Features](https://containers.dev/implementors/features/), hosted for free on GitHub Container Registry.  The example in this repository follows the [dev container Feature distribution specification](https://containers.dev/implementors/features-distribution/).  \n\u003e\n\u003e To provide feedback to the specification, please leave a comment [on spec issue #70](https://github.com/devcontainers/spec/issues/70). For more broad feedback regarding dev container Features, please see [spec issue #61](https://github.com/devcontainers/spec/issues/61).\n\n## Example Contents\n\nThis repository contains a _collection_ of two Features - `hello` and `color`. These Features serve as simple feature implementations.  Each sub-section below shows a sample `devcontainer.json` alongside example usage of the Feature.\n\n### `hello`\n\nRunning `hello` inside the built container will print the greeting provided to it via its `greeting` option.\n\n```jsonc\n{\n    \"image\": \"mcr.microsoft.com/devcontainers/base:ubuntu\",\n    \"features\": {\n        \"ghcr.io/devcontainers/feature-starter/hello:1\": {\n            \"greeting\": \"Hello\"\n        }\n    }\n}\n```\n\n```bash\n$ hello\n\nHello, user.\n```\n\n### `color`\n\nRunning `color` inside the built container will print your favorite color to standard out.\n\n```jsonc\n{\n    \"image\": \"mcr.microsoft.com/devcontainers/base:ubuntu\",\n    \"features\": {\n        \"ghcr.io/devcontainers/feature-starter/color:1\": {\n            \"favorite\": \"green\"\n        }\n    }\n}\n```\n\n```bash\n$ color\n\nmy favorite color is green\n```\n\n## Repo and Feature Structure\n\nSimilar to the [`devcontainers/features`](https://github.com/devcontainers/features) repo, this repository has a `src` folder.  Each Feature has its own sub-folder, containing at least a `devcontainer-feature.json` and an entrypoint script `install.sh`. \n\n```\n├── src\n│   ├── hello\n│   │   ├── devcontainer-feature.json\n│   │   └── install.sh\n│   ├── color\n│   │   ├── devcontainer-feature.json\n│   │   └── install.sh\n|   ├── ...\n│   │   ├── devcontainer-feature.json\n│   │   └── install.sh\n...\n```\n\nAn [implementing tool](https://containers.dev/supporting#tools) will composite [the documented dev container properties](https://containers.dev/implementors/features/#devcontainer-feature-json-properties) from the feature's `devcontainer-feature.json` file, and execute in the `install.sh` entrypoint script in the container during build time.  Implementing tools are also free to process attributes under the `customizations` property as desired.\n\n### Options\n\nAll available options for a Feature should be declared in the `devcontainer-feature.json`.  The syntax for the `options` property can be found in the [devcontainer Feature json properties reference](https://containers.dev/implementors/features/#devcontainer-feature-json-properties).\n\nFor example, the `color` feature provides an enum of three possible options (`red`, `gold`, `green`).  If no option is provided in a user's `devcontainer.json`, the value is set to \"red\".\n\n```jsonc\n{\n    // ...\n    \"options\": {\n        \"favorite\": {\n            \"type\": \"string\",\n            \"enum\": [\n                \"red\",\n                \"gold\",\n                \"green\"\n            ],\n            \"default\": \"red\",\n            \"description\": \"Choose your favorite color.\"\n        }\n    }\n}\n```\n\nOptions are exported as Feature-scoped environment variables.  The option name is captialized and sanitized according to [option resolution](https://containers.dev/implementors/features/#option-resolution).\n\n```bash\n#!/bin/bash\n\necho \"Activating feature 'color'\"\necho \"The provided favorite color is: ${FAVORITE}\"\n\n...\n```\n\n## Distributing Features\n\n### Versioning\n\nFeatures are individually versioned by the `version` attribute in a Feature's `devcontainer-feature.json`.  Features are versioned according to the semver specification. More details can be found in [the dev container Feature specification](https://containers.dev/implementors/features/#versioning).\n\n### Publishing\n\n\u003e NOTE: The Distribution spec can be [found here](https://containers.dev/implementors/features-distribution/).  \n\u003e\n\u003e While any registry [implementing the OCI Distribution spec](https://github.com/opencontainers/distribution-spec) can be used, this template will leverage GHCR (GitHub Container Registry) as the backing registry.\n\nFeatures are meant to be easily sharable units of dev container configuration and installation code.  \n\nThis repo contains a **GitHub Action** [workflow](.github/workflows/release.yaml) that will publish each Feature to GHCR. \n\n*Allow GitHub Actions to create and approve pull requests* should be enabled in the repository's `Settings \u003e Actions \u003e General \u003e Workflow permissions` for auto generation of `src/\u003cfeature\u003e/README.md` per Feature (which merges any existing `src/\u003cfeature\u003e/NOTES.md`).\n\nBy default, each Feature will be prefixed with the `\u003cowner/\u003crepo\u003e` namespace.  For example, the two Features in this repository can be referenced in a `devcontainer.json` with:\n\n```\nghcr.io/devcontainers/feature-starter/color:1\nghcr.io/devcontainers/feature-starter/hello:1\n```\n\nThe provided GitHub Action will also publish a third \"metadata\" package with just the namespace, eg: `ghcr.io/devcontainers/feature-starter`.  This contains information useful for tools aiding in Feature discovery.\n\n'`devcontainers/feature-starter`' is known as the feature collection namespace.\n\n### Marking Feature Public\n\nNote that by default, GHCR packages are marked as `private`.  To stay within the free tier, Features need to be marked as `public`.\n\nThis can be done by navigating to the Feature's \"package settings\" page in GHCR, and setting the visibility to 'public`.  The URL may look something like:\n\n```\nhttps://github.com/users/\u003cowner\u003e/packages/container/\u003crepo\u003e%2F\u003cfeatureName\u003e/settings\n```\n\n\u003cimg width=\"669\" alt=\"image\" src=\"https://user-images.githubusercontent.com/23246594/185244705-232cf86a-bd05-43cb-9c25-07b45b3f4b04.png\"\u003e\n\n### Adding Features to the Index\n\nIf you'd like your Features to appear in our [public index](https://containers.dev/features) so that other community members can find them, you can do the following:\n\n* Go to [github.com/devcontainers/devcontainers.github.io](https://github.com/devcontainers/devcontainers.github.io)\n     * This is the GitHub repo backing the [containers.dev](https://containers.dev/) spec site\n* Open a PR to modify the [collection-index.yml](https://github.com/devcontainers/devcontainers.github.io/blob/gh-pages/_data/collection-index.yml) file\n\nThis index is from where [supporting tools](https://containers.dev/supporting) like [VS Code Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) and [GitHub Codespaces](https://github.com/features/codespaces) surface Features for their dev container creation UI.\n\n#### Using private Features in Codespaces\n\nFor any Features hosted in GHCR that are kept private, the `GITHUB_TOKEN` access token in your environment will need to have `package:read` and `contents:read` for the associated repository.\n\nMany implementing tools use a broadly scoped access token and will work automatically.  GitHub Codespaces uses repo-scoped tokens, and therefore you'll need to add the permissions in `devcontainer.json`\n\nAn example `devcontainer.json` can be found below.\n\n```jsonc\n{\n    \"image\": \"mcr.microsoft.com/devcontainers/base:ubuntu\",\n    \"features\": {\n     \"ghcr.io/my-org/private-features/hello:1\": {\n            \"greeting\": \"Hello\"\n        }\n    },\n    \"customizations\": {\n        \"codespaces\": {\n            \"repositories\": {\n                \"my-org/private-features\": {\n                    \"permissions\": {\n                        \"packages\": \"read\",\n                        \"contents\": \"read\"\n                    }\n                }\n            }\n        }\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitwizeshift%2Fdevcontainer-features","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitwizeshift%2Fdevcontainer-features","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitwizeshift%2Fdevcontainer-features/lists"}