Skip to content

Commit fb12cee

Browse files
Add Dev Containers on Windows guide; refresh Docker overview (#6639)
* Add Dev Containers on Windows guide; update Docker overview - Add new hub/dev-environment/docker/dev-containers.md covering Windows-specific Dev Containers setup: WSL 2 + Docker Desktop prerequisites, the WSL 2 file system placement requirement for performance, and basic open/create workflows - Update docker/overview.md: rename Remote-Containers → Dev Containers throughout, update all /docs/remote/* URLs to /docs/devcontainers/*, replace stale 2020 blog link with link to new dev-containers.md page, bump ms.date to 2026 - Expand Docker TOC entry from single link to Overview + Dev Containers Resolves ADO 564232 Co-authored-by: Copilot <[email protected]> * Address Copilot review feedback - Add href to Docker TOC parent node so it remains clickable - Fix containers.dev attribution: OCI → Dev Container Specification site Co-authored-by: Copilot <[email protected]> * Fix TOC path style: use ./docker/ instead of ../dev-environment/docker/ Copilot correctly flagged that other entries in hub/dev-environment/toc.yml use relative ./... paths. Switched the Docker section to match, making the paths shorter and consistent with the rest of the file. Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
1 parent 4d267f6 commit fb12cee

3 files changed

Lines changed: 101 additions & 14 deletions

File tree

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
title: Set up Dev Containers on Windows
3+
description: Learn how to set up Dev Containers on Windows using Docker Desktop and WSL 2, including the key file system placement requirement for good performance.
4+
ms.topic: install-set-up-deploy
5+
ms.date: 04/15/2026
6+
---
7+
8+
# Set up Dev Containers on Windows
9+
10+
A Dev Container lets you use a Docker container as a full development environment, defined by a `devcontainer.json` file checked into your repository. Everyone who opens the project gets the same tools, extensions, and settings — regardless of what's installed on their local machine.
11+
12+
This page covers the Windows-specific setup. For a full introduction to what Dev Containers are and how they work, see [Dev Containers documentation](https://code.visualstudio.com/docs/devcontainers/containers) on the VS Code website.
13+
14+
## Prerequisites
15+
16+
Dev Containers on Windows requires:
17+
18+
- **WSL 2** — Windows Subsystem for Linux, version 2. [Install WSL](/windows/wsl/install) if you haven't already.
19+
- **Docker Desktop for Windows** with the WSL 2 backend enabled. [Download Docker Desktop](https://www.docker.com/products/docker-desktop/) and follow the installer. During setup, ensure **Use WSL 2 based engine** is selected in Docker Desktop settings (**Settings** > **General**).
20+
- **Visual Studio Code**[Download VS Code](https://code.visualstudio.com/).
21+
- **Dev Containers extension** — Install the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) from the VS Code Marketplace.
22+
23+
## Where you store your files matters
24+
25+
> [!IMPORTANT]
26+
> On Windows, Dev Container performance depends heavily on where your project files live. Store your project in the **WSL 2 file system** (for example, `/home/yourname/projects/`), not in the Windows file system (for example, `C:\Users\yourname\projects\`).
27+
28+
When your files are on the Windows file system (`C:\`), Docker accesses them through a cross-OS file share, which is significantly slower. When your files are in the WSL 2 file system, Docker uses native Linux I/O and performance is substantially better — especially for builds and file-watching tools.
29+
30+
To clone into the WSL 2 file system, open your WSL distribution (for example, Ubuntu) from the Start menu or Windows Terminal, and clone there:
31+
32+
```bash
33+
cd ~
34+
mkdir projects && cd projects
35+
git clone https://github.com/your-org/your-repo.git
36+
```
37+
38+
Then open that folder in VS Code from WSL:
39+
40+
```bash
41+
code your-repo
42+
```
43+
44+
VS Code connects to WSL and detects the `devcontainer.json` if one is present.
45+
46+
## Open a project in a Dev Container
47+
48+
Once your project is open in VS Code (connected to WSL):
49+
50+
1. Press <kbd>F1</kbd> and select **Dev Containers: Reopen in Container**.
51+
2. VS Code builds the container image defined in `.devcontainer/devcontainer.json` (or prompts you to add one if none exists).
52+
3. When the build is complete, VS Code reconnects inside the container with all configured tools and extensions available.
53+
54+
To return to your local environment, press <kbd>F1</kbd> and select **Dev Containers: Reopen Folder Locally**.
55+
56+
## Add a Dev Container to an existing project
57+
58+
If your project doesn't have a `devcontainer.json` yet:
59+
60+
1. Press <kbd>F1</kbd> and select **Dev Containers: Add Dev Container Configuration Files**.
61+
2. Choose a base image (for example, Node.js, Python, or a generic Debian/Ubuntu image).
62+
3. VS Code creates a `.devcontainer/devcontainer.json` file you can check into source control.
63+
64+
For the full reference of `devcontainer.json` options, see [devcontainer.json reference](https://containers.dev/implementors/json_reference/) on the Dev Container Specification site.
65+
66+
## Troubleshooting
67+
68+
**Container starts but file changes aren't detected**
69+
Your project is likely stored on the Windows file system. Move it into WSL (see [Where you store your files matters](#where-you-store-your-files-matters) above).
70+
71+
**Docker Desktop doesn't start or WSL integration is missing**
72+
Open Docker Desktop, go to **Settings** > **Resources** > **WSL integration**, and enable integration for your installed WSL distributions.
73+
74+
**VS Code can't connect to the container**
75+
Ensure Docker Desktop is running before opening VS Code. Check the Docker Desktop system tray icon.
76+
77+
## Next steps
78+
79+
- [Dev Containers documentation](https://code.visualstudio.com/docs/devcontainers/containers) — complete reference from the VS Code team
80+
- [devcontainer.json reference](https://containers.dev/implementors/json_reference/) — all configuration options
81+
- [Get started with Docker remote containers on WSL 2](/windows/wsl/tutorials/wsl-containers) — broader WSL + Docker setup guide
82+
- [Install WSL](/windows/wsl/install) — if you haven't set up WSL yet

hub/dev-environment/docker/overview.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Get started with Docker for remote development with containers
33
description: A complete guide to get started with Docker Desktop on Windows or WSL. Including support offered by Microsoft and variety of Azure services.
44
ms.topic: get-started
55
keywords: Microsoft, Windows, Docker, WSL, Remote development, Containers, Docker Desktop, Windows vs WSL
6-
ms.date: 09/24/2020
6+
ms.date: 04/15/2026
77
---
88

99
# Overview of Docker remote development on Windows
@@ -39,24 +39,24 @@ Using containers for remote development and deploying applications with the Dock
3939

4040
:::row:::
4141
:::column:::
42-
[![VS Code remote container graphic](../../images/vscode-remote-containers.png)](https://code.visualstudio.com/docs/remote/create-dev-container)<br>
43-
**[Create a Docker container with VS Code](https://code.visualstudio.com/docs/remote/containers-tutorial)**<br>
44-
Set up a full-featured dev environment inside of a container with the [Remote - Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) and find tutorials to set up a [NodeJS container](https://code.visualstudio.com/docs/containers/quickstart-node), a [Python container](https://code.visualstudio.com/docs/containers/quickstart-python), or a [ASP.NET Core container](https://code.visualstudio.com/docs/containers/quickstart-aspnet-core).
42+
[![VS Code remote container graphic](../../images/vscode-remote-containers.png)](https://code.visualstudio.com/docs/devcontainers/tutorial)<br>
43+
**[Dev Containers tutorial](https://code.visualstudio.com/docs/devcontainers/tutorial)**<br>
44+
Set up a full-featured dev environment inside a container with the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers). Find tutorials to set up a [Node.js container](https://code.visualstudio.com/docs/containers/quickstart-node), a [Python container](https://code.visualstudio.com/docs/containers/quickstart-python), or an [ASP.NET Core container](https://code.visualstudio.com/docs/containers/quickstart-aspnet-core).
4545
:::column-end:::
4646
:::column:::
47-
[![VSCode attach Docker screenshot](../../images/vscode-attach-docker.png)](https://code.visualstudio.com/docs/remote/attach-container)<br>
48-
**[Attach VS Code to a Docker container](https://code.visualstudio.com/docs/remote/attach-container)**<br>
49-
Learn how to attach Visual Studio Code to a Docker container that is already running or to a [container in a Kubernetes cluster](https://code.visualstudio.com/docs/remote/attach-container#_attach-to-a-container-in-a-kubernetes-cluster).
47+
[![VSCode attach Docker screenshot](../../images/vscode-attach-docker.png)](https://code.visualstudio.com/docs/devcontainers/attach-container)<br>
48+
**[Attach VS Code to a Docker container](https://code.visualstudio.com/docs/devcontainers/attach-container)**<br>
49+
Learn how to attach Visual Studio Code to a Docker container that is already running or to a [container in a Kubernetes cluster](https://code.visualstudio.com/docs/devcontainers/attach-container#_attach-to-a-container-in-a-kubernetes-cluster).
5050
:::column-end:::
5151
:::column:::
52-
[![VSCode container menu screenshot](../../images/vscode-advanced-docker.png)](https://code.visualstudio.com/docs/remote/containers-advanced)<br>
53-
**[Advanced Container Configuration](https://code.visualstudio.com/docs/remote/containers-advanced)**<br>
54-
Learn about advanced setup scenarios for using Docker containers with Visual Studio Code or read this article on how to [Inspect Containers](https://code.visualstudio.com/blogs/2019/10/31/inspecting-containers) for debugging with VS Code.
52+
[![VSCode container menu screenshot](../../images/vscode-advanced-docker.png)](https://code.visualstudio.com/docs/devcontainers/containers)<br>
53+
**[Dev Containers documentation](https://code.visualstudio.com/docs/devcontainers/containers)**<br>
54+
The full Dev Containers reference from the VS Code team, covering advanced configuration, environment variables, port forwarding, and more.
5555
:::column-end:::
5656
:::column:::
57-
[![VSCode Docker Desktop with WSL screenshot](../../images/vscode-docker-wsl.png)](https://code.visualstudio.com/blogs/2020/07/01/containers-wsl)<br>
58-
**[Using Remote Containers in WSL 2](https://code.visualstudio.com/blogs/2020/07/01/containers-wsl)**<br>
59-
Read about using Docker containers with WSL 2 (Windows Subsystem for Linux, version 2) and how to set everything up with VS Code. You can also read about [how it works](https://code.visualstudio.com/blogs/2020/03/02/docker-in-wsl2#_how-it-works).
57+
[![VSCode Docker Desktop with WSL screenshot](../../images/vscode-docker-wsl.png)](./dev-containers.md)<br>
58+
**[Set up Dev Containers on Windows](./dev-containers.md)**<br>
59+
Windows-specific setup guide covering WSL 2 and Docker Desktop configuration, and the file system placement requirement for good container performance.
6060
:::column-end:::
6161
:::row-end:::
6262

hub/dev-environment/toc.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,12 @@ items:
143143
- name: Get started with C#
144144
href: /dotnet/csharp/
145145
- name: Get started with Docker
146-
href: ../dev-environment/docker/overview.md
146+
href: ./docker/overview.md
147+
items:
148+
- name: Overview
149+
href: ./docker/overview.md
150+
- name: Set up Dev Containers on Windows
151+
href: ./docker/dev-containers.md
147152
- name: Get started with Powershell
148153
href: /powershell/
149154
- name: Get started with Rust

0 commit comments

Comments
 (0)