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
- Any repo needing onboarding velocity.
- Open-source projects with diverse contributor environments.
Common mistakes
- Heavy `postCreateCommand` — boot time bloats; bake into base image instead.
- Pinning to `latest` tags — non-reproducible.
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.
Related terms
- Browser IDE — A browser IDE is a code editor + runtime + preview that lives entirely in the web browser — StackBlitz, CodeSandbox, Replit, Glitch, GitHub.dev, vscode.dev are 2026 leaders. Zero install, instant share via URL, increasingly AI-augmented.
- Preview deploy — A preview deploy is the per-PR live URL automatically created by deploy platforms (Vercel, Netlify, Cloudflare Pages, Railway) — lets reviewers see the actual rendered change before merge.
Sources
Last updated: 2026-06-01. Raw markdown: https://promtable.com/glossary/devcontainer.md.