- Create CMakeLists.txt
touch CMakeLists.txt- Build and run the project in dev mode
docker compose up --buildThis will pull & build images and create necessary network and volumes
- Stop containers (if needed)
docker compose stopThe containers are set to restart automatically; stop them manually if not needed
- Restart containers
docker compose startdocker compose exec dev bash -c "cmake -S . -B build && cmake --build build && ./build/hello"replace ./build/hello to the name of your executable (cf CMakeLists.txt last line add_executable)
docker compose exec dev bash -c "rm -rf build/*"- Build with Ninja (if you installed it):
cmake -S . -B build # configure build directory
cmake --build build # compile the project
./build/hello # run the resulting executable- Keep the container open after running a command:
make -C build- Clean ./build folder if needed
rm -rf build/*