diff --git a/dankclaw/loki/Containerfile b/dankclaw/loki/Containerfile index b14626c..a0ef4b7 100644 --- a/dankclaw/loki/Containerfile +++ b/dankclaw/loki/Containerfile @@ -10,7 +10,12 @@ # container report its own health instead of looking merely "Up" while wedged. # # Build on dankclaw: -# podman build -t franksdank/loki:latest -f dankclaw/loki/Containerfile . +# podman build --format docker -t franksdank/loki:latest \ +# -f dankclaw/loki/Containerfile . +# +# --format docker is required: podman's default OCI image format has no +# HEALTHCHECK field, so a default-format build warns and silently discards the +# one below, leaving a container that reports no health at all. FROM docker.io/library/alpine:latest AS tools # busybox-static is statically linked: the target images have no dynamic diff --git a/scripts/deploy-remote.sh b/scripts/deploy-remote.sh index 7a67348..4fff48c 100755 --- a/scripts/deploy-remote.sh +++ b/scripts/deploy-remote.sh @@ -456,7 +456,12 @@ build_compose_image() { cfhash="$(sha256sum "$containerfile" | cut -d' ' -f1)" oldhash="$(podman image inspect "$image" --format '{{index .Config.Labels "cfhash"}}' 2>/dev/null || echo none)" if [[ "$oldhash" != "$cfhash" ]]; then - podman build --no-cache --label "cfhash=$cfhash" -t "$image" -f "$containerfile" . + # --format docker is required, not cosmetic: podman defaults to the OCI + # image format, which has no HEALTHCHECK field at all, so a build in + # the default format silently drops the loki image's healthcheck and + # the container then reports no health instead of failing loudly. + podman build --format docker --no-cache --label "cfhash=$cfhash" \ + -t "$image" -f "$containerfile" . fi } diff --git a/tests/observability_quadlet.bats b/tests/observability_quadlet.bats index aeb0a5f..38d209b 100755 --- a/tests/observability_quadlet.bats +++ b/tests/observability_quadlet.bats @@ -161,6 +161,13 @@ service_section() { grep -q 'COPY --from=tools /bin/busybox.static /usr/local/bin/busybox' "$cf" } +@test "the loki/alloy/comfyui build uses the docker image format" { + # Without --format docker the loki healthcheck is silently discarded (OCI + # has no HEALTHCHECK field) and the container stops reporting health. + grep -q -- '--format docker' "$REMOTE_DEPLOY" + grep -q 'podman build --format docker --no-cache' "$REMOTE_DEPLOY" +} + @test "grafana gets its OAuth client secret without getting a whole env file" { # systemd expands ${GRAFANA_OAUTH_CLIENT_SECRET} for the [Container] # Environment= line from the [Service] EnvironmentFile, which keeps the