Skip to content

docker: run the server on chainguard/static, not ubuntu with git - #711

Merged
lcopi merged 6 commits into
mainfrom
charlesthebird/distrolessServer
Oct 27, 2026
Merged

lcopi merged 6 commits into
mainfrom
charlesthebird/distrolessServer

Conversation

@Charlesthebird

@Charlesthebird Charlesthebird commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Description


🤖 written by Claude (start)

Change Type

/kind fix

Changelog

The server image now runs on chainguard/static as a nonroot user with no shell or git, and fixes CVEs in klauspost/compress and OpenTelemetry.

Additional Notes

  • The server has cloned Git sources with go-git since switch to go-git #698 and never shells out, so it needs neither git nor a shell.
  • The image runs as the base's nonroot user (65532); the chart still runs it as UID 1001.
  • Compose checks health with arctl-server healthcheck, and drops the sed kubeconfig rewrite and mount: the server never loads a kubeconfig, since its only Kubernetes client uses in-cluster config.
  • Anyone who runs docker exec … sh in the server container loses that shell.
Scanner Before After
trivy 1 high, 28 medium, 22 low 1 medium, no fix available
grype 1 high, 135 medium, 26 low 1 medium, no fix available

Testing

  1. Run make run-docker. docker compose -p agentregistry ps shows the server healthy.
  2. Apply a Plugin with source.type: git and an HTTPS URL using arctl apply -f. arctl get plugin <name> -o yaml shows reason: Resolved and a resolvedSource.commit.

🤖 written by Claude (end)

🤖 Generated with Claude Code

The server has cloned Git plugin sources with go-git since #698 and runs
no external binaries, so the Ubuntu base and its git package only add CVEs.
The runtime stage is now gcr.io/distroless/static-debian13, which keeps the
root default user that the Compose file relies on; the chart still sets 1001.

With no shell in the image, the Compose file rewrites the kubeconfig in a
one-shot busybox service and checks health with `arctl-server healthcheck`,
which dials the server's listen address.

Also bumps klauspost/compress to v1.18.7 and OpenTelemetry to v1.45.0 for
their CVE fixes.

Verified with trivy and grype on both images, `docker compose up -d --wait`,
and a Git plugin resolved over HTTPS as root and as UID 1001 with a
read-only root filesystem.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Nicholas Bucher <behappy54321@gmail.com>
Charlesthebird

This comment was marked as resolved.

…e in the security doc

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Nicholas Bucher <behappy54321@gmail.com>
Charlesthebird

This comment was marked as resolved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Nicholas Bucher <behappy54321@gmail.com>
@Charlesthebird

This comment has been minimized.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Nicholas Bucher <behappy54321@gmail.com>
@Charlesthebird Charlesthebird changed the title docker: run the server on distroless static, not ubuntu with git docker: run the server on chainguard/static, not ubuntu with git Oct 27, 2026
@Charlesthebird

This comment has been minimized.

The server never loads a kubeconfig: its only Kubernetes client uses
in-cluster config, and clientcmd is not linked into the binary.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Nicholas Bucher <behappy54321@gmail.com>
Charlesthebird

This comment was marked as resolved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Nicholas Bucher <behappy54321@gmail.com>
Charlesthebird

This comment was marked as resolved.

@Charlesthebird

Charlesthebird commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator Author

Before is main, after is this PR. Each ran on fresh Postgres with examples/full-stack.yaml and the same Git plugin.

Area Before After
Trivy scan 48 OS + 4 binary findings, 1 high 2 in the binary, neither has a fix
Image 214 MB, runs as root, shell and git present 73 MB on chainguard/static, runs as 65532, no shell or git
docker compose up -d --wait server healthy via a shell entrypoint server healthy via arctl-server healthcheck, two images only
Git plugin over HTTPS Resolved Resolved to the same commit, also as UID 1001 with a read-only root
Catalog UI loads servers and agents same data, same UI

🤖 written by Claude

verify-711-v3.mp4

Screenshots

Before: catalog UI before-ui-catalog
After: catalog UI after-ui-catalog

🤖 written by Claude

@Charlesthebird
Charlesthebird marked this pull request as ready for review October 27, 2026 17:48
@lcopi
lcopi added this pull request to the merge queue Oct 27, 2026
Merged via the queue into main with commit 85f11fb Oct 27, 2026
7 checks passed
@lcopi
lcopi deleted the charlesthebird/distrolessServer branch October 27, 2026 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants