This repository demonstrates a modern C++ development setup based on:
- WSL2 (Ubuntu)
- Docker Desktop
- Visual Studio Code
- Dev Containers
- CMake
- GCC/G++
- Conan
The entire toolchain is defined inside a Docker container to ensure a reproducible development environment across all machines.
Before using this repository, make sure the following software is installed on your Windows machine:
- Windows 11 (or Windows 10 with WSL2 support)
- Docker Desktop
- Visual Studio Code
Open PowerShell as Administrator and install WSL:
wsl --installRestart your computer if requested.
Verify the installation:
wsl --statusInstall Ubuntu if it is not already present:
wsl --install -d UbuntuList installed distributions:
wsl -l -vExpected output:
NAME STATE VERSION
* Ubuntu Running 2
Download and install Docker Desktop:
https://www.docker.com/products/docker-desktop/
During installation ensure:
Use WSL 2 based engine
is enabled.
After installation:
Docker Desktop
→ Settings
→ Resources
→ WSL Integration
Enable integration for your Ubuntu distribution.
Verify Docker from an Ubuntu terminal:
docker --versionExpected output:
Docker version ...
Download Visual Studio Code:
https://code.visualstudio.com/
Install the following extensions:
- Remote - WSL
- Dev Containers
- C/C++
- CMake Tools
- clangd
- Docker
- GitLens
Open an Ubuntu terminal.
Create a workspace:
mkdir -p ~/projects
cd ~/projectsClone the repository:
git clone <repository-url>
cd <repository-name>Open the project in VS Code:
code .Verify that VS Code is connected to WSL:
WSL: Ubuntu
should appear in the lower-left corner.
Inside VS Code:
Ctrl + Shift + P
Run:
Dev Containers: Rebuild and Reopen in Container
VS Code will:
- Build the Docker image
- Start the development container
- Reopen the workspace inside the container
When finished, the lower-left corner should display:
Dev Container
Open a terminal inside VS Code and execute:
g++ --version
cmake --version
conan --versionAll commands should return a version number.
Configure CMake:
cmake -B build -S .Build:
cmake --build buildExpected output:
[100%] Built target my_app
Execute:
./build/my_appExpected output:
Hello Dev Container!