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
This commit is contained in:
Frank committed 2026-08-22 04:09:04 -07:00
1 parent dc421efea4
commit 824d39a29e
4 files changed
+16 -11

No files matched your search

+4 -1
View File
@@ -9,7 +9,10 @@
# podman build -t franksdank/alloy:latest -f dankclaw/alloy/Containerfile . # podman build -t franksdank/alloy:latest -f dankclaw/alloy/Containerfile .
FROM docker.io/library/alpine:latest AS tools 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 FROM docker.io/grafana/alloy:latest
COPY --from=tools /bin/busybox /usr/local/bin/busybox COPY --from=tools /bin/busybox /usr/local/bin/busybox
+4 -1
View File
@@ -9,7 +9,10 @@
# podman build -t franksdank/loki:latest -f dankclaw/loki/Containerfile . # podman build -t franksdank/loki:latest -f dankclaw/loki/Containerfile .
FROM docker.io/library/alpine:latest AS tools 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 FROM docker.io/grafana/loki:latest
COPY --from=tools /bin/busybox /usr/local/bin/busybox COPY --from=tools /bin/busybox /usr/local/bin/busybox
+3 -6
View File
@@ -5,12 +5,9 @@ logging {
level = "info" level = "info"
} }
// Local listener so the container healthcheck can probe us. // The alloy UI service listens on 127.0.0.1:12345 by default; the
// Alloy >= 1.0 renamed the server component to ui. // in-container healthcheck probes it there. alloy 1.x refuses to
ui { // configure the ui service from a config block, so there is no block.
host = "0.0.0.0"
port = 12345
}
// Ship logs to Loki (container name on the podman network). // Ship logs to Loki (container name on the podman network).
loki.write "default" { loki.write "default" {
+5 -3
View File
@@ -158,7 +158,9 @@ CADDYFILE="$REPO_ROOT/dankclaw/Caddyfile"
[ "$n" -ge 2 ] || { echo "expected >=2 busybox healthchecks, found $n"; return 1; } [ "$n" -ge 2 ] || { echo "expected >=2 busybox healthchecks, found $n"; return 1; }
} }
@test "alloy config uses the ui component (the server component was renamed)" { @test "alloy config declares no ui/server block (default UI listens on 127.0.0.1:12345)" {
grep -qE '^ui \{' "$REPO_ROOT/shared/alloy/config.alloy" # alloy 1.x refuses to configure the ui service from a config block
! grep -qE '^server \{' "$REPO_ROOT/shared/alloy/config.alloy" # ("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"
} }