Skip to content

Chainguard Builds ​

TL;DR ​

From the HPCC-Platform repository root:

bash
./dockerfiles/chainguard/build.sh

This builds HPCC Platform and creates APK, DEB, RPM, and SBOM files using glibc 2.34 and GCC 11. Build files and packages go in:

text
build/chainguard-hpcc-glibc2.34-gcc11-amd64/

No LN checkout is required.

Setup ​

Use Docker or Podman with a running engine. macOS also supports Apple's container CLI; Windows supports Docker, Podman, or WSL containers (wslc.exe) from Git Bash.

For access to the default JFrog images and shared dependency cache, create .env in the HPCC-Platform repository root:

bash
JFROG_USERNAME=your.name@example.com
JFROG_PASSWORD='your-password-or-PAT'

Keep credentials out of version control. The file is optional if the required images are already available locally. Set ENV_FILE to use another file.

The build automatically pulls the builder image, reuses a local image if the pull fails, or builds one if needed. The first build can take longer while dependencies are downloaded and compiled.

APK builds require unprivileged user namespaces. The script checks this before building and reports any required host configuration.

Common Build Options ​

OptionPurpose
--glibc <version>Change the glibc baseline; GCC follows the baseline unless overridden.
--gcc <major>Override the GCC version.
--arch amd64 or --arch arm64Select the architecture; defaults to the host.
-f deb,rpmBuild only the listed formats instead of all three.
-b <directory>Change the build directory.
-o <directory>Write packages and SBOMs to a separate directory.
--containerizedBuild for Kubernetes rather than host installation.
--no-pullReuse or build a local builder image without pulling it.
--helpShow all options.

For example, build DEB and RPM packages with glibc 2.39 and its paired GCC 13:

bash
./dockerfiles/chainguard/build.sh --glibc 2.39 -f deb,rpm

Each baseline and architecture gets a separate default build directory. Kubernetes builds also add -containerized to the directory name. If you use -b, keep separate directories for different toolchains and build modes.

The default glibc 2.34 baseline targets Ubuntu 21.10 or later, Rocky 9 or later, and Wolfi. Rocky 8 is not supported. Newer baselines require newer target libraries.

Run CMake Directly ​

Use cmake-chainguard.sh to run a CMake command inside the builder with the same arguments:

bash
./dockerfiles/chainguard/cmake-chainguard.sh --version

It defaults to glibc 2.34 and GCC 11. Set CHAINGUARD_GLIBC and CHAINGUARD_GCC to override them.

The proxy runs only the requested CMake command. It does not supply HPCC's configure flags, build automatically, or create packages. Use build.sh for the complete HPCC build.

Build a Development Image ​

The build script handles this automatically. To prepare the default image separately:

bash
./dockerfiles/chainguard/create-build-image.sh --glibc 2.34

Run create-build-image.sh with --help for options.

Runtime Image Audit ​

The runtime-audit target in Dockerfile.runtime checks the assembled runtime before the final image can be built. Its Python check uses the native HPCC compiler, eclcc -Me, to evaluate a foldable EMBED(Python3) function inside the runtime rootfs. The function reads sys.version_info; its result must match RUNTIME_PYTHON, which must also match PYTHON in the packaged hpcc-baseline. Missing libraries, plugin initialization/evaluation failures, and version mismatches fail the audit rather than bypassing it.

Do not test libpy3embed.so with Python's ctypes.CDLL. This is an HPCC embedding plugin, not a Python extension: its global initialization initializes the interpreter and releases the GIL with PyEval_SaveThread. Loading it from an already-running Python interpreter interferes with that host's interpreter and thread state. The previous ctypes audit segfaulted (exit 139) with Python 3.12; that failure alone does not establish a packaging or ABI defect. Native ECL evaluation exercises the supported embedding path instead. This smoke check does not replace the Python embedding regression suite or prove that every distributed query works.

LN Builds ​

To build LN, run its wrapper from the LN repository root instead:

bash
./dockerfiles/chainguard/build.sh

The wrapper uses the sibling HPCC-Platform checkout for tooling, reads LN's .env, and writes to ../build/chainguard-glibc2.34-gcc11/. Use -s /path/to/HPCC-Platform to select another checkout.

Released under the Apache-2.0 License.