Skip to content
Back to skills

Devcontainers Knowledge Patch

ASecurity

Dev Containers

  • 25 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 5, 2026
developmentpythonrustc++shellnodedockergitfrontend

Works with

  • cli

Security analysis

A92/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 7 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add Nevaberry/nevaberry-plugins --skill devcontainers-knowledge-patch --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Devcontainers Knowledge Patch?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Devcontainers Knowledge Patch
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nevaberry-devcontainers-knowledge-patch-nevaberry-plugins/badge)](https://www.skillsdirectory.com/skills/nevaberry-devcontainers-knowledge-patch-nevaberry-plugins)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: devcontainers-knowledge-patch
description: Dev Containers
version: null
license: MIT
metadata:
  author: Nevaberry
---


# Dev Containers Knowledge Patch

Load this skill when installing or operating the Dev Container CLI, configuring
container metadata and lifecycle hooks, authoring Features or Templates, or
working with Feature dependencies and lockfiles. Consult the matching reference
for detailed behavior and examples.

## Reference index

| Reference | Topics |
| --- | --- |
| [CLI compatibility and operations](references/cli.md) | Installation, workspaces, execution, authentication, diagnostics, caching, Docker and Podman compatibility |
| [Configuration and lifecycle](references/configuration.md) | Discovery, metadata representation and merging, users, environment, Compose services, readiness and hooks |
| [Feature authoring](references/features.md) | Options, installers, accounts, dependencies, ordering, resource names, publishing and tests |
| [Feature lockfiles](references/lockfiles.md) | CLI generation and inspection, deprecated flags, upgrades, original proposal records and integrity |
| [Template authoring](references/templates.md) | Layout, options, substitution, optional paths, versions and OCI metadata |

## Compatibility changes and deprecations

Starting in CLI 0.87.0, `build` and `up` generate Feature lockfiles by default.
Use `--no-lockfile` to skip generation or `--frozen-lockfile` to fail when the
lockfile is missing or would change.

```sh
devcontainer build --no-lockfile
devcontainer up --frozen-lockfile
```

The old `--experimental-lockfile` and `--experimental-frozen-lockfile` flags
still work and emit deprecation warnings. Starting in CLI 0.86.1, Features
supplied with `--additional-features` are excluded from the generated lockfile.

Starting in CLI 0.53.0, read `publishedTags` from `features info`,
`features publish`, and `templates publish` output. Earlier versions used
`publishedVersions` for that key.

Starting in CLI 0.61.0, `--image-name` suppresses the automatically generated
image name. Scripts supplying a name should use that name for the build output.

Starting in CLI 0.86.0, the CLI writes `devcontainer.metadata` as a JSON array,
even for one entry. The specification accepts a single JSON object as an image
label input; see the configuration reference for label limits and merge rules.

The CLI redirects Feature references from `devcontainers-contrib` to
`devcontainers-extra`. Existing `devcontainer.json` files can keep the old
publisher name.

The CLI lists `devcontainer stop` and `devcontainer down` as planned commands.

## Installation and everyday commands

The standalone install script bundles Node.js and supports Linux and macOS on
x64 and arm64. Its default executable directory is `$HOME/.devcontainers/bin`.
The CLI reference contains the installation commands and script options.

Install Python and a C/C++ toolchain before `npm install -g @devcontainers/cli`;
the npm installation compiles a dependency.

The CLI ignores `HOME` when it points to a non-writable directory, allowing
commands to run with a read-only home directory.

Starting in CLI 0.82.0, commands use the current directory when no workspace
folder is specified. `devcontainer exec` runs a command in the running dev
container with `userEnvProbe`, `remoteUser`, and `remoteEnv` applied.

```sh
devcontainer exec --workspace-folder . env
```

Starting in CLI 0.91.0, use `--docker-arg` for global Docker CLI options.

```sh
devcontainer up --workspace-folder . --docker-arg=--debug
```

## Registry authentication and diagnostics

CLI 0.89.0 adds `--oci-auth-hardening` to opt in to stricter OCI registry
authentication. It supports trusted cross-origin authentication host mappings
and diagnostics for assessing registry compatibility before rollout.

CLI 0.91.0 includes OCI authentication diagnostics in failed `devcontainer up`
results. For blocked lookups, these report the lookup kind and blocking reason.

Starting in CLI 0.39.0, fetching OCI Features and Templates checks credentials
in this order:

1. `DEVCONTAINERS_OCI_AUTH`
2. The Docker credential helper configured for the registry
3. The Docker credential store configured in Docker's config file
4. Credentials stored directly in Docker's config file
5. The platform's default credential helper
6. `GITHUB_TOKEN`

Starting in CLI 0.42.0, an OCI bearer-token request is retried anonymously when
credentials appear to have expired. Starting in CLI 0.73.0, the CLI
reauthenticates with an OCI registry after an HTTP 403 response.

Starting in CLI 0.90.0, registry inspection accepts valid image references
containing both a tag and a digest (`image:tag@digest`).

## Build cache and engine compatibility

CLI 0.61.0 accepts `--cache-from` and `--cache-to` on `devcontainer up` for
importing and exporting build cache. Starting in CLI 0.59.0,
`--build-no-cache` also disables the cache for the Feature build.

```sh
devcontainer up --cache-to type=local,dest=/tmp/devcontainer-cache
```

Starting in CLI 0.83.0, the build path that adds Features uses
`BUILDKIT_INLINE_CACHE` to enable BuildKit's inline cache. Starting in CLI
0.85.0, resolving a Dockerfile's base image and user substitutes Buildx's
global build- and target-platform variables.

On Docker Engine 23.0.0 and newer, CLI 0.80.3 skips downloading and injecting
`dockerfile:1.4` because the engine ships that frontend version or a newer one.

CLI 0.77.0 resolves conflicts between Podman's `--userns` and explicit
`--uidmap` or `--gidmap` mappings. It omits `--userns=keep-id` when Podman runs
as root. Starting in CLI 0.80.0, Podman containers use `label=disable` in place
of the `z` mount flag.

## Configuration, metadata, and lifecycle

Search the workspace source folder for `.devcontainer/devcontainer.json`, then
`.devcontainer.json`, then `.devcontainer/<folder>/devcontainer.json` with one
level of nesting. Multiple configurations may coexist, and tools can let users
select one.

At container creation, local `devcontainer.json` is the final merge source;
string variables are substituted when their values are applied. When extending
a prebuilt image, retain its existing `devcontainer.metadata` entries and append
separate snippets for each added Feature and the new build's `devcontainer.json`.

A later `portsAttributes` entry replaces the entire attribute object for that
port; a later `otherPortsAttributes` replaces the entire default attribute
object. `containerEnv` and `remoteEnv` take the last value per variable.

`remoteEnv` applies after the image's `ENTRYPOINT` and can change during the
container's lifetime. `userEnvProbe` collects variables using the configured
shell type; the tool merges them with the remote environment for injected
processes.

`waitFor` blocks readiness through the selected creation hook and defaults to
`updateContentCommand`. Tool setup can run while `postCreateCommand` is still
in the background. Set `waitFor` to `postCreateCommand` if setup depends on
that hook finishing.

```json
{
  "waitFor": "postCreateCommand"
}
```

A lifecycle hook object runs its named commands in parallel. Every command
must exit successfully for the hook to succeed. On resume, the tool restarts
related containers and performs its own setup before running `postStartCommand`
and `postAttachCommand`.

## Feature installers and dependencies

Option IDs become installer environment variables by replacing punctuation
with underscores, collapsing a leading run of digits and underscores to one
underscore, and uppercasing. Unset options use manifest defaults; booleans
arrive as strings `true` and `false`. A string-valued Feature entry in
`devcontainer.json` supplies the Feature's `version` option.

Build tools should set the execute bit on `install.sh` and invoke it directly
so its shebang selects the interpreter. Feature `containerEnv` values become
Dockerfile `ENV` instructions before the installer runs.

`dependsOn` recursively schedules required Features with specified options and
honors OCI tag or digest pins. Creation fails if any dependency cannot be
installed. For locally authored Features, resolve relative dependency paths
from the directory containing the active `devcontainer.json`.

`installsAfter` uses unversioned IDs matched by canonical name, including
renamed Features. It applies only to Features already queued through
configuration or hard dependencies. A cycle among applicable ordering
constraints should fail resolution.

`overrideFeatureInstallOrder` gives earlier unversioned IDs higher priority
across matching instances whose hard and applicable soft dependencies are
satisfied. An ID absent from the resolved installation set may cause resolution
to fail.

One published Feature can run more than once with different options; its
installer needs to tolerate repeated changes to shared state such as `PATH`.
The Feature reference gives deduplication rules and installation-round ordering.

For each hook, Feature contributions run from the project workspace in Feature
installation order, before the matching hook in `devcontainer.json`. All
commands in one Feature's object-form hook finish before the next Feature or
the user's hook begins.

Use `${devcontainerId}` in eligible strings of `entrypoint`, `mounts`, and
`customizations` to name resources after the build. This alphanumeric ID is
unique on the host and stable across rebuilds; prebuilt images need to keep
it out of build inputs.

## Lockfile inspection and Template application

The CLI names the Feature lockfile `.devcontainer-lock.json`. The original
proposal uses `devcontainer-lock.json` alongside `devcontainer.json`; the
lockfile reference preserves that proposal's record and artifact rules.

Run `devcontainer outdated` to see which locked Features have newer versions.
Starting in CLI 0.52.0, `upgrade` regenerates the Feature lockfile; starting in
CLI 0.53.0, `--dry-run` previews the upgrade.

```sh
devcontainer upgrade --dry-run
```

Template option defaults are strings, including `"true"` and `"false"` for
boolean options. Tooling substitutes `${templateOption:<id>}` in file contents
before copying them into the workspace.

Declare Template `optionalPaths` relative to the Template root. Use the full
relative path for a file with no leading or trailing slash, and append `/*`
to a directory path so excluding it omits all descendants and the directory.
Starting in CLI 0.68.0, use `--omit-paths` with `devcontainer templates apply`
to leave out optional files or directories.

Files in this skill

  • SKILL.md9 KB
  • coverage.json989 B
  • references/cli.md3.8 KB
  • references/configuration.md3.6 KB
  • references/features.md4.3 KB
  • references/lockfiles.md2.3 KB
  • references/templates.md1.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.