A lightweight Alpine-based Docker image for C/C++ development, debugging, and CI builds, with vcpkg preinstalled.
Image: rayyounghong/cpp-build-env-alpine — built nightly for linux/amd64 and linux/arm64.
- Base:
alpine:latest(small footprint, musl libc). - Toolchains: GCC (
gcc,g++,build-base) and Clang (clang,lldb). - Build systems:
make,ninja,cmake,autoconf,automake,libtool. - Debugging / profiling:
gdb,lldb,strace,valgrind. - Package manager: vcpkg preinstalled at
/home/builder/vcpkg, onPATH, withVCPKG_ROOTset. Bootstrapped with metrics disabled andVCPKG_FORCE_SYSTEM_BINARIES=1(required on Alpine/musl). - Utilities:
git,curl,tar,zip,unzip,rsync,dos2unix,bash. - Locale & time:
tzdata+musl-locales, configured toen_US.UTF-8/Etc/UTC. - Non-root user: runs as
builder(uid fromadduser -D) with/workspaceas the working directory. - Multi-arch: published for
linux/amd64andlinux/arm64.
Pull the image:
docker pull rayyounghong/cpp-build-env-alpine:latestDrop into a shell with your project mounted at /workspace:
docker run --rm -it -v "$PWD":/workspace rayyounghong/cpp-build-env-alpine:latest bashUse it as a CI build environment, e.g. in GitHub Actions:
jobs:
build:
runs-on: ubuntu-latest
container: rayyounghong/cpp-build-env-alpine:latest
steps:
- uses: actions/checkout@v4
- run: cmake -S . -B build -G Ninja
- run: cmake --build buildInstall dependencies with vcpkg (manifest mode):
vcpkg install- Compiling with vcpkg on Alpine requires
VCPKG_FORCE_SYSTEM_BINARIES=1(already set in the image) because vcpkg's prebuilt tool binaries are not musl-compatible. - The image is rebuilt nightly against
alpine:latest, solatestfollows upstream Alpine and vcpkgHEAD. Pin by digest if you need reproducible builds.