Technical Documentation: marmelab/Features
โน๏ธ Provenance: Multi-Tier Ingestion ยท CodeWiki Reference
Overview (`README.md`)
Marmelab Dev Container Features
A collection of custom dev container Features, published to GitHub Container Registry following the dev container Feature distribution specification.
Features
`claude-code`
Installs the Claude Code CLI and, in VS Code, the Claude Code extension. See src/claude-code.
{
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"ghcr.io/marmelab/devcontainers/claude-code:1": {},
},
}$ claude --versionRepository structure
Each published Feature lives in its own sub-folder under src, containing a devcontainer-feature.json, an entrypoint install.sh, and a README.md. Tests live under test/<feature>.
โโโ src
โ โโโ claude-code
โ โโโ devcontainer-feature.json
โ โโโ install.sh
โ โโโ README.md
โโโ test
โ โโโ claude-code
โ โโโ test.sh
โ โโโ non_root_user.sh
โ โโโ scenarios.json
โโโ .devcontainer
โโโ claude-code # local dogfood copy (see below)Developing this repository
This repo's own Dev Container installs Claude Code via a local copy of the feature at .devcontainer/claude-code. It is a separate copy because the Dev Container CLI only resolves local features inside the .devcontainer/ folder, so the published src/claude-code cannot be referenced directly. Keep the two in sync. Credential mounts for the container are declared in .devcontainer/devcontainer.json.
An implementing tool will composite the documented dev container 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.
Options
All 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.
For example, the claude-code feature exposes a version option. If no option is provided in a user's devcontainer.json, the value falls back to its default (latest).
{
// ...
"options": {
"version": {
"type": "string",
"proposals": ["latest", "stable"],
"default": "latest",
"description": "Version passed to the official installer.",
},
},
}Options are exported as Feature-scoped environment variables. The option name is capitalized and sanitized according to option resolution.
#!/bin/bash
echo "Activating feature 'claude-code' (version: ${VERSION})"
...Distributing Features
Versioning
Features 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.
Publishing
NOTE: The Distribution spec can be found here.
While any registry implementing the OCI Distribution spec can be used, this template will leverage GHCR (GitHub Container Registry) as the backing registry.
Features are meant to be easily sharable units of dev container configuration and installation code.
This repo contains a GitHub Action workflow that will publish each Feature to GHCR.
Allow GitHub Actions to create and approve pull requests should be enabled in the repository's Settings > Actions > General > Workflow permissions for auto generation of src/<feature>/README.md per Feature (which merges any existing src/<feature>/NOTES.md).
By default, each Feature will be prefixed with the <owner>/<repo> namespace. For example, the Features in this repository can be referenced in a devcontainer.json with:
ghcr.io/marmelab/devcontainers/claude-code:1The provided GitHub Action will also publish a "metadata" package with just the namespace, eg: ghcr.io/marmelab/devcontainers. This contains information useful for tools aiding in Feature discovery.
'marmelab/devcontainers' is known as the feature collection namespace.
Marking Feature Public
Note that by default, GHCR packages are marked as private. To stay within the free tier, Features need to be marked as public.
This 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:
https://github.com/users/<owner>/packages/container/<repo>%2F<featureName>/settingsAdding Features to the Index
If you'd like your Features to appear in our public index so that other community members can find them, you can do the following:
- Go to github.com/devcontainers/devcontainers.github.io
- This is the GitHub repo backing the containers.dev spec site
- Open a PR to modify the collection-index.yml file
This index is from where supporting tools like VS Code Dev Containers and GitHub Codespaces surface Features for their dev container creation UI.
Using private Features in Codespaces
For 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.
Many 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
An example devcontainer.json can be found below.
{
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"ghcr.io/my-org/private-features/hello:1": {
"greeting": "Hello",
},
},
"customizations": {
"codespaces": {
"repositories": {
"my-org/private-features": {
"permissions": {
"packages": "read",
"contents": "read",
},
},
},
},
},
}Overview (`src/claude-code/README.md`)
Claude Code (claude-code)
Installs the Claude Code CLI (and, in VS Code, the Claude Code extension).
Example Usage
"features": {
"ghcr.io/marmelab/devcontainers/claude-code:1": {}
}Options
| Options Id | Description | Type | Default Value |
|---|---|---|---|
| version | Version passed to the official installer: 'latest', 'stable', or a specific version such as '1.0.0'. | string | latest |
What it does
- Downloads and runs the official installer from
https://claude.ai/install.shas the container user. - Symlinks the CLI into
/usr/local/binso it is onPATHin login, non-interactive, and CI shells, and adds$HOME/.local/binto~/.bashrcand~/.zshrcfor interactive shells. - In VS Code, installs the
Anthropic.claude-codeextension.
Installs curl and CA certificates first if they are missing (Debian/Ubuntu bases).
Using your Claude credentials
The feature does not mount credentials, because bind mounts are host-specific and
belong in the consuming devcontainer.json. To authenticate Claude Code inside the
container from your host setup, add the mounts yourself:
{
"features": {
"ghcr.io/marmelab/devcontainers/claude-code:1": {},
},
"mounts": [
{
"type": "bind",
"source": "${localEnv:HOME}/.claude.json",
"target": "/home/<user>/.claude.json",
},
{
"type": "bind",
"source": "${localEnv:HOME}/.claude",
"target": "/home/<user>/.claude",
},
],
}Replace `` with your container user (for example node or vscode). The host~/.claude.json file and ~/.claude directory must already exist, otherwise the bind
mount fails the container build.
Overview (`src/playwright/README.md`)
Playwright integration
Installs Playwright system dependencies (via the playwright-deps feature) and
persists downloaded browsers in a named volume across container rebuilds.
See install.sh, install-browsers.sh, and
devcontainer-feature.json.
Options
| Option | Type | Default | Description |
|---|---|---|---|
browsers |
string | chromium,firefox,webkit |
Comma-separated browsers to download at container creation. Use all for every browser, or none to skip the download. |
{
"features": {
"./playwright": { "browsers": "chromium" },
},
}The selected browsers are downloaded by install-browsers.sh
(run via postStartCommand), which reads the selection persisted byinstall.sh and calls npx playwright install. It runs at post-start rather
than post-create because
Feature lifecycle commands always run before the user's own commands of the
same stage: a post-create hook here would fire before your npm install, soplaywright would not exist yet. The download uses npx --no-install, so it
only ever uses the project's own playwright and skips cleanly (with a hint) if
none is installed, instead of fetching an arbitrary version from the registry.
System dependencies
OS-level browser dependencies are installed at build time by theplaywright-deps
feature, declared in dependsOn. Per the dev container spec, dependsOn values
are static and cannot reference this feature's options, so dependencies for all
three browsers are always installed regardless of the browsers option. The
option only controls which browser binaries are downloaded (the main disk and
time cost).
Cache folder
Browsers are cached at PLAYWRIGHT_BROWSERS_PATH (default /mnt/ms-playwright).
To change the folder, override this env var in your devcontainer.json; the
volume mount follows automatically:
{
"features": { "./playwright": {} },
"containerEnv": { "PLAYWRIGHT_BROWSERS_PATH": "/custom/path" },
}--- METRICS ---
- Files Extracted: 3
- Estimated Token Budget: ~2917 tokens
- Canonical Reference: https://codewiki.google/github.com/marmelab/Features