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
These are the handful of devcontainer.json keys that define what your environment actually is — which image or Dockerfile to build from, where your code mounts, which tools and extensions get installed, and which user the editor runs as. If you only ever learn one table here, make it this one: nearly every dev container starts as some combination of these 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. |