concept

Devcontainer

A devcontainer (`.devcontainer/devcontainer.json`) is the open spec for reproducible dev environments — defines base image, features, extensions, ports — used by GitHub Codespaces, VS Code Dev Containers, Gitpod, JetBrains Space.

Devcontainers solve 'works on my machine' for development: the repo declares its dev environment (Docker image, language version, VS Code extensions, exposed ports), any IDE supporting the spec can spin up an identical environment. GitHub Codespaces popularized the pattern; VS Code Dev Containers, Gitpod, JetBrains Space, IntelliJ Code With Me support it. Configuration: `devcontainer.json` with image / Dockerfile reference, features (preinstalled tools — `node`, `python`, `aws-cli`), `forwardPorts`, `postCreateCommand`. Production benefits: every new dev gets identical environment in < 1 minute; CI can use the same container; switching machines is instant. By 2026 devcontainers are standard for serious OSS repos + many enterprise dev teams.

When to use devcontainer

Common mistakes

FAQ

What is devcontainer?

A devcontainer (`.devcontainer/devcontainer.json`) is the open spec for reproducible dev environments — defines base image, features, extensions, ports — used by GitHub Codespaces, VS Code Dev Containers, Gitpod, JetBrains Space.

When should I use devcontainer?

Any repo needing onboarding velocity. Open-source projects with diverse contributor environments.

What are the most common mistakes with devcontainer?

Heavy `postCreateCommand` — boot time bloats; bake into base image instead. Pinning to `latest` tags — non-reproducible.

Sources

Last updated: 2026-06-01. Raw markdown: https://promtable.com/glossary/devcontainer.md.