From 824d39a29e70a9e164a354a049bd00fab8b65f3a Mon Sep 17 00:00:00 2001 From: Frank Date: Sat, 22 Aug 2026 04:09:04 -0700 Subject: [PATCH] busybox-static for healthchecks; alloy: rely on the default UI listener - alpine's /bin/busybox is musl-dynamic and cannot execute in the distroless loki image (missing loader); busybox-static links in - alloy 1.x refuses to configure the ui service from a config block; the default UI already listens on 127.0.0.1:12345 where the healthcheck probes --- dankclaw/alloy/Containerfile | 5 ++++- dankclaw/loki/Containerfile | 5 ++++- shared/alloy/config.alloy | 9 +++------ tests/caddyfile.bats | 8 +++++--- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/dankclaw/alloy/Containerfile b/dankclaw/alloy/Containerfile index 97008cf..6beb1e6 100644 --- a/dankclaw/alloy/Containerfile +++ b/dankclaw/alloy/Containerfile @@ -9,7 +9,10 @@ # podman build -t franksdank/alloy:latest -f dankclaw/alloy/Containerfile . FROM docker.io/library/alpine:latest AS tools -# busybox provides wget for the healthcheck. +# busybox-static is statically linked: the target images have no dynamic +# loader (loki is distroless), so the alpine default /bin/busybox (musl +# dynamic) would fail with "no such file or directory". +RUN apk add --no-cache busybox-static FROM docker.io/grafana/alloy:latest COPY --from=tools /bin/busybox /usr/local/bin/busybox \ No newline at end of file diff --git a/dankclaw/loki/Containerfile b/dankclaw/loki/Containerfile index cef73c4..e1869e0 100644 --- a/dankclaw/loki/Containerfile +++ b/dankclaw/loki/Containerfile @@ -9,7 +9,10 @@ # podman build -t franksdank/loki:latest -f dankclaw/loki/Containerfile . FROM docker.io/library/alpine:latest AS tools -# busybox provides wget for the healthcheck. +# busybox-static is statically linked: the target images have no dynamic +# loader (loki is distroless), so the alpine default /bin/busybox (musl +# dynamic) would fail with "no such file or directory". +RUN apk add --no-cache busybox-static FROM docker.io/grafana/loki:latest COPY --from=tools /bin/busybox /usr/local/bin/busybox \ No newline at end of file diff --git a/shared/alloy/config.alloy b/shared/alloy/config.alloy index 97020ad..6f26b61 100644 --- a/shared/alloy/config.alloy +++ b/shared/alloy/config.alloy @@ -5,12 +5,9 @@ logging { level = "info" } -// Local listener so the container healthcheck can probe us. -// Alloy >= 1.0 renamed the server component to ui. -ui { - host = "0.0.0.0" - port = 12345 -} +// The alloy UI service listens on 127.0.0.1:12345 by default; the +// in-container healthcheck probes it there. alloy 1.x refuses to +// configure the ui service from a config block, so there is no block. // Ship logs to Loki (container name on the podman network). loki.write "default" { diff --git a/tests/caddyfile.bats b/tests/caddyfile.bats index 1a36423..a206cf3 100644 --- a/tests/caddyfile.bats +++ b/tests/caddyfile.bats @@ -158,7 +158,9 @@ CADDYFILE="$REPO_ROOT/dankclaw/Caddyfile" [ "$n" -ge 2 ] || { echo "expected >=2 busybox healthchecks, found $n"; return 1; } } -@test "alloy config uses the ui component (the server component was renamed)" { - grep -qE '^ui \{' "$REPO_ROOT/shared/alloy/config.alloy" - ! grep -qE '^server \{' "$REPO_ROOT/shared/alloy/config.alloy" +@test "alloy config declares no ui/server block (default UI listens on 127.0.0.1:12345)" { + # alloy 1.x refuses to configure the ui service from a config block + # ("service ui does not support being configured"). The default UI + # already listens where the in-container healthcheck probes. + ! grep -qE '^(ui|server) \{' "$REPO_ROOT/shared/alloy/config.alloy" }