Developer ToolsVS Code
toolsvscodeGuideIntermediate
VS Code: Dev Containers Introduction
Complete introduction to Development Containers (.devcontainer/devcontainer.json), containerized toolchains, automated onboarding, and Docker isolation.
Verified: 2026-09-30
Tested on:vscode 1.93.x, docker 27.x
Platforms:
linuxmacoswindows
#vscode#devcontainers#docker#reproducibility
The Dev Containers extension (ms-vscode-remote.remote-containers) allows you to use a Docker container as a full-featured development environment.
Why Use Dev Containers?
- Zero Local SDK Installations: Developers don't need to install Node, Python, Rust, Go, or Postgres directly on their host OS.
- Instant Team Onboarding: New developers clone the repository, click "Reopen in Container", and have all compilers, linters, extensions, and databases pre-configured in minutes.
- No "Works on My Machine": 100% environment parity between team members across macOS, Windows (WSL2), and Linux.
Configuring .devcontainer/devcontainer.json
Create .devcontainer/devcontainer.json in your repository:
{
"name": "Node.js & TypeScript Dev Container",
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers-contrib/features/pnpm:2": {}
},
"customizations": {
"vscode": {
"extensions": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"bradlc.vscode-tailwindcss",
"prisma.prisma"
],
"settings": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
}
}
},
"forwardPorts": [3000],
"postCreateCommand": "pnpm install"
}Opening a Dev Container
- Install Dev Containers extension (
ms-vscode-remote.remote-containers). - Open project folder in VS Code.
- Press Cmd/Ctrl + Shift + P $\rightarrow$
Dev Containers: Reopen in Container. - VS Code builds the Docker container image, installs extensions inside the container, and mounts your workspace files seamlessly.
Related Guides
VS Code: Remote - SSH Development
Complete guide to using the Remote - SSH extension in VS Code to edit files, run debuggers, and execute terminals on remote Linux servers and cloud VMs.
Prettier: Opinionated Code Formatter
Complete guide to the Prettier VS Code extension, configuration (.prettierrc), format on save, Tailwind CSS plugin sorting, and avoiding ESLint conflicts.