The repository contains a C++ starter project with a CMakeLists.txt. The project is also using the boost testing libraries.
git clone git@github.com:AndriyKalashnykov/cpp-sample-app.git
cd cpp-sample-app
cmake .
make
make test
./hello
This docker build does the following:
- Uses mutistage build
- Uses GCC 9.2.0 as a
build
image - Installs cmake and boost
- Sets /app as working directory
- Runs cmake and make
- Uses distroless images as runtime
- Copies
hello
application asnonroot
user - Specifies an unprivileged
nonroot
user for running the application - Set the command
hello
to run when starting the container
docker build -t gcc-cpp:1.0 .
docker run --rm gcc-cpp:1.0