← All cheatsheets
Dev Environments Cheatsheet
Share consistent, containerized dev workspaces with one click from Docker Desktop.
What it is
Docker Dev Environments let you define a reproducible development workspace as code (devcontainer.json) and share it with teammates so everyone works in the same containerized environment.
Installation
Available in Docker Desktop 4.x+. Requires VS Code with the Remote – Containers extension for IDE integration.
Quick start
Create a Dev Environment from a Git URL.
Open a Dev Environment in VS Code.
List all Dev Environments.
devcontainer.json example
Minimal .devcontainer/devcontainer.json for Node.js
{
"name": "Node.js Dev",
"image": "mcr.microsoft.com/devcontainers/node:20",
"postCreateCommand": "npm install",
"forwardPorts": [3000],
"customizations": {
"vscode": {
"extensions": ["dbaeumer.vscode-eslint"]
}
}
}Best practices
- Commit .devcontainer/devcontainer.json to your repo so teammates can reproduce your environment.
- Use postCreateCommand to run npm install / pip install automatically on environment creation.
- Forward only the ports your app needs to keep the environment secure.
Related cheatsheets
Last reviewed: 2026-06-15