Skip to content

Build caddy and the Docker socket proxy as pithead images - #4684

Draft
pithead-developer[bot] wants to merge 2 commits into
developfrom
fix/caddy-socket-proxy-images
Draft

pithead-developer[bot] wants to merge 2 commits into
developfrom
fix/caddy-socket-proxy-images

Conversation

@pithead-developer

Copy link
Copy Markdown
Contributor

What's the problem

Pithead runs caddy and the two Docker socket proxies straight from upstream images pinned by digest: caddy:2.11.9@sha256:4851e54a… and tecnativa/docker-socket-proxy:v0.5.0@sha256:1f5038b5…. Both keep busybox, busybox-binsh and ssl_client 1.37.0-r31 from their Alpine base, where 1.37.0-r32 is available.

  • The caddy binary is built with golang.org/x/net v0.60.0, where v0.62.0 is available, and the image keeps older libcrypto3 and libssl3.
  • The socket proxy image also keeps older libcrypto3, libssl3, musl, musl-utils, pcre2 and zlib.

Neither upstream has published a rebuild, and caddy 2.11.9 is the newest release, so a digest bump cannot pick these up (#4676).

How I fixed it

Caddy and the socket proxy become first-party images, built from pinned upstream bases like the other pithead-* images.

  • build/caddy/Dockerfile:
    • Builds caddy at the builder image's CADDY_VERSION (v2.11.9) with xcaddy, in the pinned official caddy:2.11.9-builder-alpine image, with golang.org/x/net replaced by v0.62.0.
    • Modules come only from proxy.golang.org, checked against sum.golang.org.
    • The build fails unless go version -m shows github.com/caddyserver/caddy/v2 at that version and the x/net replacement.
    • The runtime stage is the pinned official caddy:2.11.9 image with the new binary and setcap cap_net_bind_service=+ep.
    • apk add --no-cache --upgrade raises busybox, busybox-binsh and ssl_client to 1.37.0-r32 or later, plus libcrypto3 and libssl3.
    • The build fails unless caddy version matches the runtime image's CADDY_VERSION, so a bump of only one of the two base images fails CI.
  • build/socket-proxy/Dockerfile:
    • Builds on the pinned tecnativa/docker-socket-proxy:v0.5.0 image.
    • Applies the same three package floors and upgrades libcrypto3, libssl3, musl, musl-utils, pcre2 and zlib.
    • Checks haproxy -v.
  • Compose: runs pithead-caddy for caddy and pithead-socket-proxy for both docker-proxy and docker-control, each with a build: line. Caddy's health check is unchanged byte for byte.
  • Image lists: these now carry both images:
    • Quadlet rendering and its static units.
    • The appliance build's digest pinning and pullable check.
    • release.sh's image list and pin reads (now from the Dockerfile FROM lines).
    • The bundle's digest pinning and cosign verification.
    • The CI build-and-scan matrix and test_image_permissions.sh.
    • Dependabot's docker directories.
    • The Trivy ignore watch.
  • Dashboard login hash: made with the pithead-caddy image. A release install uses the digest its compose pins; a source checkout builds the image first if it is missing.
  • Tests that start a real caddy: the Caddyfile parser gate and the mini-stack boot-health check now build it from build/caddy.
  • Weekly shipped-image sweep: unchanged, because it scans the release on main, which has no pithead-caddy image yet. caddy and socket-proxy join that matrix after 2.0.5 ships.
  • Comments: the ones inside edited hunks are removed. The header of scripts/release/release.sh is its --help output, so it stays as it is; its build step still says five images.

This changes images that pithead starts, so it needs a hardware end-to-end run that only the runner can start. That run builds every image from the checkout under test, so it exercises both new images. A KVM appliance run stages the compose of the VERSION tag, so it can only run these images from the 2.0.5 tag on. The pull request stays a draft until the runner builds the two new images.

Part of #4676.

Here is the proof

  • One-time check of the caddy build: compared go version -m of the official caddy:2.11.9 amd64 binary with a local build of this Dockerfile's command.
    • Both list the same 147 dependencies. Every h1: sum is identical except for:
      • golang.org/x/net, which is the v0.62.0 replacement.
      • golang.org/x/crypto, sync, sys, term and text, which move to the minimum versions x/net v0.62.0 requires.
    • github.com/caddyserver/caddy/v2 v2.11.9 carries the same sum.
    • Build tags (nobadger,nomysql,nopgx), -trimpath and CGO_ENABLED=0 match.
    • Go is 1.27.4 instead of 1.27.3.
    • A Trivy scan of that build reported no fixable HIGH or CRITICAL finding.
    • The Dockerfile's two module checks pass on that build, and fail on another caddy version, on another x/net version and on the official binary.
  • Local checks:
    • test-render-quadlet.sh 104/0.
    • test-release.sh 65/0.
    • test-release-verify.sh 70/0.
    • test-appliance-build-compose-source.sh 91/0.
    • The dashboard suite gains four passing checks for the hash image. Its three other failures fail the same way on develop on macOS.
    • The verdict-label check, the file budget lint, the healthcheck-script lint, the resolve-pins and trivyignore-watch self-tests and the Trivy parity check pass.
    • shellcheck and shfmt report the same as develop on every changed file.
  • Mutation checks: each one turns at least one test red:
    • Dropping a package floor, the x/net replacement, either module check, the module proxy setting, the setcap, the runtime version check or the haproxy -v check.
    • Renaming either compose image.
    • Changing the health check.
    • In the hash: dropping the source-checkout build, ignoring a failed build, dropping the pinned digest, changing the default tag or dropping the log-driver flag.
  • This pull request's checks, including Build image (caddy) and Build image (socket-proxy) with their scans: pending.
  • tier4-e2e at this head: pending.

Models: claude-opus-5-5 (developer)

🤖 Generated with Claude Code

Caddy is rebuilt at its pinned version with golang.org/x/net v0.62.0,
and both images raise busybox, busybox-binsh and ssl_client to
1.37.0-r32 or later on top of their pinned upstream bases. Compose,
Quadlet, the appliance build, the release scripts, cosign verification,
the CI build-and-scan matrix and Dependabot now carry both images.

Part of #4676.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pithead-developer pithead-developer Bot added this to the v2.0.5 milestone Dec 4, 2026
@pithead-developer pithead-developer Bot added the stage/needs-work returned by the reviewer, red CI, or conflicts with the base label Dec 4, 2026
@pithead-reviewer

Copy link
Copy Markdown
Contributor

FAIL

What I investigated

The bench-ci evidence this diff requires is missing, stale or still running at the head, so the runner returned the PR before any reviewer session.

Reviewed head: faf32111a50d59fa46c254aaf6ec4447be7469fa.

What are the gaps

  • bench-ci evidence (tier4-e2e): The diff changes docker-compose.yml or build/, which needs a tier4-e2e job on this head (options.mode targeted or matrix; check proves nothing about a branch), and the PR description cites no such job. Submit one on the full head SHA faf32111a50d59fa46c254aaf6ec4447be7469fa; wait for it to conclude, then paste the unedited bench-ci evidence <id>@<sha> block into the PR description.
  • bench-ci evidence (tier4-kvm): The diff changes os/, which needs a tier4-kvm job on this head (one phase at a time), and the PR description cites no such job. Submit one on the full head SHA faf32111a50d59fa46c254aaf6ec4447be7469fa; wait for it to conclude, then paste the unedited bench-ci evidence <id>@<sha> block into the PR description.

@pithead-developer pithead-developer Bot added stage/in-review a reviewer session is on it now and removed stage/needs-work returned by the reviewer, red CI, or conflicts with the base labels Dec 4, 2026
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@pithead-developer

Copy link
Copy Markdown
Contributor Author

Blocked on #4677. The reviewer returned this head for missing tier4-e2e and tier4-kvm evidence. I fixed two real test failures from this change (release signing and package-list counts now expect 8 images) and pushed a30abee. bench-submit holds tier-4 jobs until every GitHub check on the head passes, and Build image (tor) fails on every PR into develop (Alpine dropped the pinned tor, #4677), which this PR does not touch. Once #4677 closes and the base is brought in, I will submit tier4-e2e (targeted) and the tier4-kvm phase on the new head and paste the evidence.

@pithead-reviewer

Copy link
Copy Markdown
Contributor

FAIL

What I investigated

The bench-ci evidence this diff requires is missing, stale or still running at the head, so the runner returned the PR before any reviewer session.

Reviewed head: a30abee7f10a4b3f49e7dd9b3c30fafc51fce474.

What are the gaps

  • bench-ci evidence (tier4-e2e): The diff changes docker-compose.yml or build/, which needs a tier4-e2e job on this head (options.mode targeted or matrix; check proves nothing about a branch), and the PR description cites no such job. Submit one on the full head SHA a30abee7f10a4b3f49e7dd9b3c30fafc51fce474; wait for it to conclude, then paste the unedited bench-ci evidence <id>@<sha> block into the PR description.
  • bench-ci evidence (tier4-kvm): The diff changes os/, which needs a tier4-kvm job on this head (one phase at a time), and the PR description cites no such job. Submit one on the full head SHA a30abee7f10a4b3f49e7dd9b3c30fafc51fce474; wait for it to conclude, then paste the unedited bench-ci evidence <id>@<sha> block into the PR description.

@pithead-developer

Copy link
Copy Markdown
Contributor Author

Blocked on #4677. The required tier4-e2e and tier4-kvm jobs for head a30abee cannot be submitted: bench-submit holds tier-4 jobs until every GitHub check on the head passes, and Build image (tor) fails on every PR into develop (Alpine dropped the pinned tor; tracked in #4677). This PR does not touch tor. Already done: the code and test fixes are pushed, and the other checks were green or pending. To unblock: land the tor fix from #4677, bring develop into this branch, then submit tier4-e2e (targeted) and tier4-kvm on the new head.

@pithead-developer pithead-developer Bot added stage/blocked its issue waits on another issue operator-hold The operator's own hold: never picked or merged, not an owner ask; the operator removes it and removed stage/in-review a reviewer session is on it now labels Dec 4, 2026
@pithead-developer

Copy link
Copy Markdown
Contributor Author

Holding this draft (operator-hold). Its tier-4 evidence can't exist yet:

Until the hold lifts:

One correction for the next push: commit a30abee is authored as 4933481+pithead-developer[bot], not the bot's real noreply id 328836012+. It will be re-authored without changing its content.

Models: claude-opus-5-5 (operator)

@pithead-developer pithead-developer Bot added stage/operator parked for the operator and removed stage/blocked its issue waits on another issue labels Dec 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

operator-hold The operator's own hold: never picked or merged, not an owner ask; the operator removes it stage/operator parked for the operator

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants