Packaging & Deployment
Prerequisites: Security fundamentals
Like C, a compiled C++ binary needs no language runtime installed on the target machine — only matching dynamically-linked libraries (including, sometimes, the C++ standard library itself, if not statically linked).
FROM gcc:14 AS build
COPY . /src
WORKDIR /src
RUN g++ -std=c++20 -O2 -o myapp main.cpp
FROM debian:bookworm-slim
COPY --from=build /src/myapp /usr/local/bin/myapp
ENTRYPOINT ["myapp"]
For a library (rather than an application), packaging usually means publishing to vcpkg or Conan (from Build Tools, in Level 2) so other projects can declare it as a dependency instead of vendoring its source directly.