Skip to content

distroless: swap base to base-nossl-debian13 - #107837

Merged
motsc merged 1 commit into
ClickHouse:masterfrom
motsc:distroless-base-nossl-swap
Jun 21, 2026
Merged

motsc merged 1 commit into
ClickHouse:masterfrom
motsc:distroless-base-nossl-swap

Conversation

@motsc

@motsc motsc commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

Followup to #107677. clickhouse already statically links its own openssl/libstdc++/zlib/zstd/gomp — only 5 glibc libs in DT_NEEDED (librt, libpthread, libc, libm, libdl). So the 7 packages cc-debian13 ships on top of glibc (gcc-14-base libgcc-s1 libgomp1 libssl3t64 libstdc++6 libzstd1 zlib1g) are dead weight we chase CVEs on every few weeks. libssl3t64 was the latest one. Swap to base-nossl-debian13:nonroot drops them all. Base goes 13 -> 6 packages.

i wanted to be sure the binary really doesn't need any of that before flipping, so i ran a broad smoke on 26.5.2.39 across both arches:

  • --version on server + keeper, prod + debug targets, amd64 + arm64. all clean, dynamic linker happy.
  • server starts, takes HTTP queries, native TCP on 9000 via clickhouse-client (incl. LZ4), and inbound HTTPS with a self-signed cert (TLSv1.3 / AEAD-AES256-GCM-SHA384).
  • outbound HTTPS via url('https://api.github.com/zen') and url('https://...s3.amazonaws.com/...') — handshakes complete, bodies returned. statically-linked openssl client doesn't need libssl3t64.
  • SQL crypto: SHA224/256/384/512, MD5, AES-256-CTR and AES-256-GCM encrypt+decrypt round-trip, randomString/randomPrintableASCII length + entropy. byte-identical hashes between amd64 and arm64.
  • ZSTD column codec ALTER + OPTIMIZE FINAL round-trips rows. GZIP HTTP Content-Encoding: gzip works both directions. statically-linked zstd + zlib OK.
  • 2-server ReplicatedMergeTree on a 3-node Keeper quorum: insert on srv-1 replicates to srv-2 in ~1s, bit-identical SHA256 over the id set. killed the Keeper leader mid-flight, re-election in ~1s, data preserved.
  • inter-server replication over HTTPS only (interserver_http_port removed entirely, interserver_https_port=9010, mounted cert): 3000 rows fetched srv-1 -> srv-2 in 2s, bit-identical. that's the inter-server TLS data plane proven, not just the listener.
  • Trivy --severity HIGH,CRITICAL --ignore-unfixed on all four prod images (server/keeper × amd64/arm64): 0 findings.
  • no <Error> or <Fatal> log lines in any container during any of the above.

CA bundle /etc/ssl/certs/ca-certificates.crt still ships in base-nossl, outbound verification unchanged. /busybox/pgrep story is identical to cc-debian13 — present in debug-nonroot, absent in nonroot. operator probe path is unaffected either way.

Prod image sizes: 790 MB amd64, 755 MB arm64.

Changelog category (leave one):

  • Build/Testing/Packaging Improvement

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Switch the distroless server and keeper images to gcr.io/distroless/base-nossl-debian13 so they only ship the libraries ClickHouse actually links against and stop pulling in ones we statically link ourselves.

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Version info

  • Merged into: 26.6.1.1088

ClickHouse statically links its own openssl, libstdc++, zlib, zstd, gomp.
The binary's DT_NEEDED is only 5 glibc libs (librt, libpthread, libc,
libm, libdl), so the 7 extra packages the cc-debian13 base ships are
dead weight that each turn into a recurring CVE chase (libssl3t64 was
the latest, fixed in ClickHouse#107677).

Swap server + keeper Dockerfile.distroless to base-nossl-debian13:nonroot
which keeps glibc and drops gcc-14-base, libgcc-s1, libgomp1, libssl3t64,
libstdc++6, libzstd1, zlib1g. Base package count goes 13 -> 6.

Smoke-tested on amd64 with VERSION=26.5.2.39:
  - clickhouse --version / server --version / keeper --version all clean
  - server starts, MergeTree+INSERT 10k rows, ZSTD codec round-trip OK
  - outbound HTTPS via url() to api.github.com and S3 works (TLS handshake
    succeeds — confirms statically-linked openssl is self-sufficient)
  - keeper 4LW (ruok->imok, mntr, srvr) responds, no errors in logs
  - Trivy --severity HIGH,CRITICAL --ignore-unfixed: 0 on both prod images

Follow-up to ClickHouse#107677.
@clickhouse-gh

clickhouse-gh Bot commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [463eb89]

Summary: ✅


AI Review

Summary

This PR swaps the server and keeper distroless runtime bases from gcr.io/distroless/cc-debian13 to gcr.io/distroless/base-nossl-debian13, keeping the pinned production and debug variants in sync. I did not find a correctness issue in the Dockerfile changes: the inspected base image still contains the glibc/NSS/CA pieces the image relies on, while dropping the shared OpenSSL/libstdc++/libgcc/zlib/zstd/libgomp libraries described in the PR.

Missing context / blind spots
  • ⚠️ The current Praktika report for 463eb898e40999732f6c791fffee2b4eaabd44ce still had Build (amd_release), Build (arm_release), Docker server image, Docker keeper image, and Finish Workflow not completed at review time. Passing those jobs would close the automated validation gap for the rebuilt images.
Final Verdict

Status: ✅ Approve

No inline findings. Merge should still wait for the pending Docker image CI to finish successfully.

@clickhouse-gh clickhouse-gh Bot added the pr-build Pull request with build/testing/packaging improvement label Jun 18, 2026
@motsc
motsc marked this pull request as ready for review June 18, 2026 10:16
@motsc motsc added the can be tested Allows running workflows for external contributors label Jun 18, 2026
@motsc
motsc requested a review from maxknv June 18, 2026 11:38
@motsc
motsc enabled auto-merge June 18, 2026 12:30
@motsc
motsc added this pull request to the merge queue Jun 21, 2026
Merged via the queue into ClickHouse:master with commit 7508b07 Jun 21, 2026
488 of 490 checks passed
@motsc
motsc deleted the distroless-base-nossl-swap branch June 21, 2026 22:27
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Jun 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors pr-build Pull request with build/testing/packaging improvement pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants