Sign inSign up

stden/cpp

By stden

•Updated 1 day ago

Build C++ programs and check test coverage and memory use.

Image
Languages & frameworks
Developer tools
0

1.3K

stden/cpp repository overview

⁠stden/cpp

Build C++ programs and check test coverage and memory use.

⁠Overview

This image uses the official GCC base image. It includes g++, CMake, Git, gcovr, lcov, Valgrind, and tree. Use it for C++ builds, coverage reports, and memory checks. When you mount your project, set the working directory with -w.

⁠Tags

TagMeaningPlatform
latestLatest successful build from mainlinux/amd64

The latest tag changes after a new build passes its tests. See all tags and digests⁠.

⁠Use

Build and check a program from main.cpp in your current directory:

docker pull stden/cpp:latest
docker run --rm -v "$PWD":/workspace -w /workspace stden/cpp:latest \
  bash -c 'g++ --coverage -g -O0 main.cpp -o app && ./app && gcovr --root . && valgrind --error-exitcode=1 ./app'

For a CMake project:

docker run --rm -v "$PWD":/workspace -w /workspace stden/cpp:latest \
  bash -c 'cmake -S . -B build && cmake --build build && ctest --test-dir build --output-on-failure'

The image does not include project libraries. Install extra dependencies in a child image. For example, if your project uses Boost.Filesystem, add libboost-filesystem-dev. Build output and coverage files stay in the mounted project directory. Files that the container creates belong to root.

⁠Checks

The smoke test compiles a C++ program with coverage enabled. It runs the program, generates a gcovr report, and runs Valgrind with an error exit code.

⁠Source

Tag summary

Content type

Image

Digest

sha256:b4fd0f873…

Size

622.3 MB

Last updated

1 day ago

docker pull stden/cpp