Skip to content

CARRY: build Konflux supervisor and CLI images with static glibc instead of musl - #25

Merged
andre-motta merged 1 commit into
opendatahub-io:mainfrom
EmilienM:glibc-static
Aug 11, 2026
Merged

CARRY: build Konflux supervisor and CLI images with static glibc instead of musl#25
andre-motta merged 1 commit into
opendatahub-io:mainfrom
EmilienM:glibc-static

Conversation

@EmilienM

@EmilienM EmilienM commented Aug 11, 2026

Copy link
Copy Markdown

Summary

The Konflux (RHEL, hermetic) supervisor and CLI images built their Rust binaries as fully-static musl binaries. That meant building musl libc from source and installing the musl rust-std target, which drove RHEL-219374 (asking Red Hat to ship rust-std-static-musl) and required a prodsec exception for the from-source musl build.

This builds both binaries as fully-static glibc binaries instead: install glibc-static from the public UBI9 CodeReady Builder repo and compile the existing GNU target with -C target-feature=+crt-static. No musl anywhere, so RHEL-219374 and the prodsec exception are no longer needed.

Follows upstream NVIDIA#2682, which added the glibc-static mechanism to the non-Konflux build path (it kept musl as the default and did not touch these Konflux images).

Related Issue

No GitHub issue: this is midstream productization build tooling (Dockerfile.konflux.* / deploy/konflux/* exist only in this fork). Driven by RHEL-219374 and follows upstream NVIDIA#2682.

Changes

  • deploy/docker/Dockerfile.konflux.{supervisor,cli}: remove the build-musl-from-source stage; dnf install glibc-static; compile <arch>-unknown-linux-gnu with RUSTFLAGS="-C target-feature=+crt-static"; update comments and image LABELs (musl → glibc).
  • deploy/konflux/{supervisor,cli}/generic-fetcher.yaml: drop the musl source tarball and both rust-std-*-musl artifacts. The GNU rust-std shipped with the toolchain is reused.
  • deploy/konflux/{supervisor,cli}/rpms.in.yaml: add glibc-static; drop gzip (only the musl .tar.gz used it; it remains available transitively). Both declare the CRB repo (ubi-9-codeready-builder-rpms, public UBI CDN) inline, matching the gateway config. The CLI was converged from repofiles/base-image ubi.repo to the same inline repos: + in-file arches: + context.bare: true form, so a clean rpm-lockfile-prototype regeneration is repo-explicit and consistent across all three Konflux configs (verified: clean regen reproduces the identical package set with glibc-static/libxcrypt-static from CRB).
  • deploy/konflux/{supervisor,cli}/rpms.lock.yaml: add glibc-static + its dependency libxcrypt-static for both arches. Entries were produced with rpm-lockfile-prototype and spliced onto the current lockfile to keep the diff to just these two packages. A full regeneration additionally bumps kernel-headers/libarchive/libgcrypt/tzdata to newer CDN builds; that unrelated drift is left to MintMaker.

Testing

  • Fully static (build): compiled the real openshell-sandbox with the new mechanism in a UBI9 container → ET_DYN static-PIE, no PT_INTERP, no DT_NEEDED, ldd → "statically linked". There is no openssl-sys/openssl in Cargo.lock (TLS is rustls + aws-lc-rs/ring), so nothing links dynamic OpenSSL.
  • NSS across base images (runtime): a fully-static glibc binary resolved DNS (getaddrinfo), users (getpwnam/getpwuid), and groups (getgrnam) successfully in Alpine (musl), busybox, and UBI9 containers. Static glibc links its default files+dns NSS services in, so no runtime .so dlopen is needed and the injected supervisor keeps resolving inside non-glibc user containers. The link-time Using 'getaddrinfo' in statically linked applications ... warning is expected and does not reflect a runtime failure for the default services.
    • Residual caveat: a user container with a custom /etc/nsswitch.conf pointing hostname/user resolution at non-default modules (sss/ldap/mdns/myhostname) is the only case that could differ; standard files dns entries still resolve. This is inherent to any static-glibc binary.
  • Lockfiles: glibc-static 2.34-275.el9_8 matches the already-pinned glibc-devel; libxcrypt-static 4.4.18-3.el9 is the only added transitive dep; all six edited YAML files parse.
  • Not run here — recommended merge gate: full mise run e2e sandbox path exercised against a non-glibc/distroless user container (per AGENTS.md "Sandbox Infra Changes"), and a check of whether static glibc also resolves the ndots:5 DNS behavior behind Supervisor's musl DNS resolver fails for external domains in Kubernetes (ndots:5) NVIDIA/OpenShell#2053 (glibc's resolver is expected to handle it, unlike musl).

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs: none needed — architecture/build.md documents the unchanged upstream musl build path; the Konflux images have no architecture doc.
  • E2E across base images — recommended as the merge gate (see Testing).

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

The CLI and supervisor Dockerfiles replace static musl builds with static glibc builds on UBI9. The builders use GNU Rust targets and +crt-static. RPM inputs and lockfiles add glibc-static and libxcrypt-static for aarch64 and x86_64. Musl toolchain artifacts and dependencies are removed. Image metadata now identifies static glibc linking.

Estimated code review effort: 3 (Moderate) | ~25 minutes

🚥 Pre-merge checks | ✅ 10
✅ Passed checks (10 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Contribution Quality And Spam Detection ✅ Passed PASS: The signed-off commit is a focused 8-file Konflux toolchain change, cites RHEL-219374 and upstream #2682, pins both arches, and documents static/runtime validation; no qualifying security or...
No Hardcoded Secrets ✅ Passed No hardcoded credentials, private keys, embedded URL credentials, secret-like literal assignments, or standalone base64 secrets were found; added hashes are SHA-256 integrity pins (CWE-798 not obse...
No Weak Cryptography ✅ Passed The commit changes only Dockerfile/YAML deployment metadata; added-line scanning found no MD5, SHA1, DES, 3DES, RC4, Blowfish, or ECB use, and SHA-256 values are artifact checksums (no CWE-327 find...
No Injection Vectors ✅ Passed PASS — HEAD^..HEAD adds only Docker/YAML build metadata; scans found no CWE-78, CWE-89, CWE-94, CWE-502, or CWE-79 sink, and YAML/lockfiles parse with HTTPS checksum-pinned RPMs.
No Privileged Containers ✅ Passed Changed Dockerfiles and Konflux YAML contain no privileged, host namespace, SYS_ADMIN, privilege-escalation, USER root, or runAsUser: 0 settings; CLI runtime uses USER 1000:1000.
No Sensitive Data In Logs ✅ Passed CWE-532 review passed: changed files add no logging of secrets, PII, tokens, or request bodies; the only echo writes non-sensitive RUST_TARGET to /tmp/build-env.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the main change: building Konflux supervisor and CLI images with static glibc instead of musl.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@deploy/docker/Dockerfile.konflux.supervisor`:
- Around line 83-84: Update the runtime stage around the openshell-sandbox COPY
and entrypoint to create and use a dedicated non-root runtime user via USER.
Ensure any required network operations are handled by a narrowly privileged
helper or only the minimal necessary capabilities, while preserving the existing
binary execution behavior.

In `@deploy/konflux/cli/rpms.in.yaml`:
- Around line 15-22: Update the repository declarations in the RPM input
configuration to explicitly include the UBI CDN repository named
ubi-9-codeready-builder-rpms, matching the established declaration in the
supervisor RPM configuration. Ensure this repository is available to
rpm-lockfile-prototype during clean regeneration while preserving the existing
package list.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 2f12adc8-42f4-4971-8055-ac8b2b2b66a1

📥 Commits

Reviewing files that changed from the base of the PR and between c06ef02 and e293af1.

📒 Files selected for processing (8)
  • deploy/docker/Dockerfile.konflux.cli
  • deploy/docker/Dockerfile.konflux.supervisor
  • deploy/konflux/cli/generic-fetcher.yaml
  • deploy/konflux/cli/rpms.in.yaml
  • deploy/konflux/cli/rpms.lock.yaml
  • deploy/konflux/supervisor/generic-fetcher.yaml
  • deploy/konflux/supervisor/rpms.in.yaml
  • deploy/konflux/supervisor/rpms.lock.yaml
💤 Files with no reviewable changes (2)
  • deploy/konflux/supervisor/generic-fetcher.yaml
  • deploy/konflux/cli/generic-fetcher.yaml

Comment thread deploy/docker/Dockerfile.konflux.supervisor
Comment thread deploy/konflux/cli/rpms.in.yaml
@EmilienM EmilienM changed the title build(konflux): build supervisor and cli images with static glibc instead of musl CARRY: build Konflux supervisor and CLI images with static glibc instead of musl Aug 11, 2026

@andre-motta andre-motta left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

…ead of musl

The Konflux (RHEL, hermetic) supervisor and CLI images built their Rust
binaries as fully-static musl binaries, which meant building musl libc from
source and installing the musl rust-std target. That drove RHEL-219374
(asking Red Hat to ship rust-std-static-musl) and needed a prodsec exception
for the from-source musl build.

Build both as fully-static glibc binaries instead: install glibc-static from
the public UBI9 CodeReady Builder repo and compile the existing GNU target
with `-C target-feature=+crt-static`. This removes the musl-from-source stage,
the musl rust-std prefetch, and the rust-std-static-musl dependency, so the
productized images no longer depend on musl.

The binaries remain genuinely fully static (static-PIE, no PT_INTERP, no
DT_NEEDED). Static glibc resolves DNS, users, and groups through its built-in
default files+dns NSS services, verified working in Alpine, busybox, and UBI
containers, so the injected supervisor keeps functioning in non-glibc user
containers.

Follows upstream NVIDIA#2682, which added the glibc-static build
mechanism to the non-Konflux path.

Signed-off-by: Emilien Macchi <emacchi@redhat.com>
@andre-motta
andre-motta merged commit ccacc37 into opendatahub-io:main Aug 11, 2026
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants