buildkit
by QuenchWorks
BuildKit, the concurrent container image build engine behind docker build, running rootless. Hardened by QuenchWorks as a minimal, nonroot, CVE-gated image, cosign-signed and pinned by digest.
About this chart
buildkit
BuildKit, the concurrent container image build engine behind docker build,
running rootless. buildkitd runs as uid 1001 inside a user namespace set up by
rootlesskit, on the QuenchWorks image: hardened, CVE-gated, pinned by digest and
cosign-signed.
Install
helm install bk oci://ghcr.io/quenchworks/charts/buildkit
Build against it from a pod in the same namespace:
buildctl --addr tcp://bk-buildkit:1234 build \
--frontend dockerfile.v0 --local context=. --local dockerfile=. \
--output type=image,name=registry.example.com/app:1,push=true
Or register it with Docker Buildx:
docker buildx create --name quench --driver remote tcp://bk-buildkit:1234
What rootless needs
The pod is not privileged and runs nothing as root on the node. It does need three things the chart sets by default:
| Setting | Why |
|---|---|
seccompProfile: Unconfined, appArmorProfile: Unconfined | the runtime profiles block the unshare and mount calls rootlesskit makes |
allowPrivilegeEscalation: true | newuidmap is setuid; without it the bit is ignored |
capabilities drop: [ALL], add: [SETUID, SETGID] | the only capabilities newuidmap needs to write the subuid range |
--oci-worker-no-process-sandbox is on (extraArgs), as upstream recommends in
Kubernetes: a nested PID namespace needs a fresh /proc mount an unprivileged pod
cannot make. The root filesystem stays read-only; buildkitd writes only to its
cache, temp and runtime volumes.
A namespace enforcing the restricted Pod Security Standard rejects this pod.
baseline does not allow Unconfined seccomp either; label the namespace
privileged or exempt it.
Security of the endpoint
A build endpoint runs whatever it is sent. Two controls:
- NetworkPolicy (on by default) admits only pods in the release namespace.
networkPolicy.allowExternal: trueopens it cluster-wide. - mTLS: set
tls.existingSecretto a Secret withca.crt,tls.crtandtls.key(for example from cert-manager). buildkitd then only accepts clients with a certificate signed by that CA.
Values
| Key | Default | Meaning |
|---|---|---|
service.port | 1234 | gRPC endpoint |
tls.existingSecret | "" | Secret for mTLS; empty is plaintext |
persistence.enabled | false | keep the build cache on a PVC instead of an emptyDir |
persistence.size | 20Gi | PVC size |
extraArgs | [--oci-worker-no-process-sandbox] | extra buildkitd flags |
replicaCount | 1 | independent daemons, each with its own cache |
networkPolicy.allowExternal | false | admit clients from other namespaces |
The common production knobs (resources, scheduling, probes, extra volumes, sidecars)
come from quench-common.
Release gate
On kind, the gate installs the chart with its default security context, then:
- runs a Dockerfile build with a
RUNstep inside the daemon pod, and checks the step ran as root inside the build's user namespace; - connects a separate client pod over the Service and lists the workers.
The chart depends on the quench-common chart from oci://ghcr.io/quenchworks/charts.
Deploy buildkit with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has buildkit on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartbuildkit is pinned at v0.0.22 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply