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.
In more detail
What it means
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.
Part 1 of 2
When to use it, and when not
Use it for
- Any repo needing onboarding velocity.
- Open-source projects with diverse contributor environments.
Part 2 of 2
Common mistakes
- Heavy `postCreateCommand` — boot time bloats; bake into base image instead.
- Pinning to `latest` tags — non-reproducible.
FAQ
Questions readers ask.
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 you use devcontainer?
Any repo needing onboarding velocity. Open-source projects with diverse contributor environments.
What are the common mistakes with devcontainer?
Heavy `postCreateCommand` — boot time bloats; bake into base image instead. Pinning to `latest` tags — non-reproducible.
Last updated: 2026-06-01. Raw markdown: https://promtable.com/glossary/devcontainer.md. Found a mistake? Tell us.