This repository provides a template-based workflow for VS Code Dev Containers. Each local workspace starts from projects/.template/ and lives under projects/.
- Docker is available on the host.
- VS Code has the
ms-vscode-remote.remote-containersextension installed.
- Download the repository (e.g.,
git clone https://github.com/iplaylf2/vscode-container.git). - Create
projects/<your-project-name>fromprojects/.template/.- On Windows, use the
robocopycommand in Windows Symlinks instead of a normal copy.
- On Windows, use the
- Edit
projects/<your-project-name>/docker-compose.yamlas needed. - Open
projects/<your-project-name>in VS Code and runDev Containers: Reopen in Container.
After the container is created, VS Code opens the workspace at /src/<your-project-name>. The data lives in a Docker volume named <your-project-name>_workspace.
projects/.template uses symlinks for shared configuration. On Windows, run the setup commands from an Administrator PowerShell so Git and robocopy preserve those links.
From a normal PowerShell window at the repository root, run one of the following commands to open an elevated shell in the same directory:
# Windows PowerShell
Start-Process powershell -Verb RunAs -WorkingDirectory (Get-Location)
# PowerShell 7+
Start-Process pwsh -Verb RunAs -WorkingDirectory (Get-Location)Then run the setup commands in the Administrator PowerShell:
# Enable symlink support in this repo.
git config --local core.symlinks true
# Restore symlinks if Git checked them out as regular files (destructive: discards local changes).
git checkout -f
# Copy the template while preserving symlinks and skipping unchanged files.
robocopy projects/.template projects/<your-project-name> /E /SL /XC /XN /XO