C++ development container for VS Code that supports both Docker and Podman.
This devcontainer provides a reproducible C++ build environment using CMake, and can be used with either Docker or Podman as the container runtime.
- Works with VS Code Dev Containers
- Supports Docker and Podman
- Non-root user inside container
- UID/GID matching with host
- Forwards host SSH keys for Git access
- VS Code
- Dev Containers extension
- Docker or Podman installed on Host
Make sure that podman is installed and accessible
$ podman --versionOpen VS Code settings for workspace
Ctrl + Shift + P-> Preference Open Workspace Settings- Search
containers.containerClientand set it topodman. This tells the VS Code Dev Containers extension to use Podman instead of Docker.
TODO : Test and Write
Clone this repository (if you haven’t already) and open it in VS Code.
Press Ctrl + Shift + P → Dev Containers: Reopen in Container
mkdir -p build
cd build
cmake ..
cmake --build .
$ cd build
$ ./hello_world/hello_world
Hello and welcome to C++!
i = 1
i = 2
i = 3
i = 4
i = 5