DevContainers (Development Containers) provide containerized development environments based on the Development Container Specification maintained at containers.dev. They define complete, reproducible development setups using a devcontainer.json configuration file, enabling "works on my machine" elimination by packaging tools, runtimes, SDKs, and settings into a Docker container. Supported natively by VS Code, GitHub Codespaces, JetBrains IDEs (2025.3+), and DevPod, dev containers shift environment setup from documentation to executable code, ensuring all contributors work in identical environments from day one. The key mental model: a dev container is not just a deployment target but your actual IDE workspace, where the editor connects remotely to the container's running processes, filesystem, and tooling — making local setup conflicts and dependency drift obsolete.
What This Cheat Sheet Covers
This topic spans 17 focused tables and 111 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
Table 1: Core Configuration Properties
| Property | Example | Description |
|---|---|---|
"name": "Python 3 Dev" | Display name shown in VS Code UI and Codespaces interface; purely for human readability. | |
"image": "mcr.microsoft.com/devcontainers/python:3.12" | Specifies a pre-built container image from Docker Hub, MCR, or private registry; most direct way to start. | |
"dockerfile": "Dockerfile" | Path to a custom Dockerfile (relative to devcontainer.json); overrides image if both are present. | |
"dockerComposeFile": "docker-compose.yml" | Enables multi-container setups with Docker Compose; specify which service is the dev container with service property. | |
"service": "app" | When using Docker Compose, identifies the service in the compose file that VS Code attaches to. |