aboutsummaryrefslogtreecommitdiffstats
path: root/image-builder
diff options
context:
space:
mode:
Diffstat (limited to 'image-builder')
-rwxr-xr-ximage-builder/bootstrap.sh1
-rwxr-xr-ximage-builder/build-full-image.sh2
-rwxr-xr-ximage-builder/build-sbo-testbuild.sh1
-rw-r--r--image-builder/lib.sh9
-rwxr-xr-ximage-builder/test-image-builder.sh8
5 files changed, 21 insertions, 0 deletions
diff --git a/image-builder/bootstrap.sh b/image-builder/bootstrap.sh
index 250da44..7316116 100755
--- a/image-builder/bootstrap.sh
+++ b/image-builder/bootstrap.sh
@@ -556,6 +556,7 @@ DOCKERFILE
# Main
# ============================================================================
+require_docker
rc=0
for VERSION in "${BUILD_VARIANTS[@]}"; do
if changelog_changed "${VERSION}"; then
diff --git a/image-builder/build-full-image.sh b/image-builder/build-full-image.sh
index f6814bd..3706186 100755
--- a/image-builder/build-full-image.sh
+++ b/image-builder/build-full-image.sh
@@ -228,6 +228,8 @@ DOCKERFILE
# Main
# ============================================================================
+require_docker
+
# A --force build passes --no-cache, so the stale build cache is dead weight:
# it still loads the containerd snapshotter's lease/lock bookkeeping and has
# raced the layer export ("failed to open writer: ref ... locked ... unavailable").
diff --git a/image-builder/build-sbo-testbuild.sh b/image-builder/build-sbo-testbuild.sh
index 8778897..f982a91 100755
--- a/image-builder/build-sbo-testbuild.sh
+++ b/image-builder/build-sbo-testbuild.sh
@@ -134,6 +134,7 @@ DOCKERFILE
_log "=== Done: ${TB_TAG} ==="
}
+require_docker
require_pkgs
rc=0
for VERSION in "${BUILD_VARIANTS[@]}"; do
diff --git a/image-builder/lib.sh b/image-builder/lib.sh
index dfb076b..8a22828 100644
--- a/image-builder/lib.sh
+++ b/image-builder/lib.sh
@@ -72,6 +72,15 @@ txz_hash() {
done <<< "$files" | sha256sum | cut -d' ' -f1
}
+# require_docker
+# Assert the docker daemon answers before any variant is attempted. A dead
+# daemon is global, not per-variant: without this each variant "fails and
+# continues", the digest probes read as "no digest, rebuild to be safe", and
+# cron logs warnings nightly while nothing is ever built. Fail loudly once.
+require_docker() {
+ docker info >/dev/null 2>&1 || _err "docker daemon not reachable; is dockerd running?"
+}
+
# require_mount VERSION
# Assert the NAS tree for VERSION is mounted (file:// mirror only).
# x86_64 tree dir is slackware64-${VERSION}.
diff --git a/image-builder/test-image-builder.sh b/image-builder/test-image-builder.sh
index 525ea8f..5781b22 100755
--- a/image-builder/test-image-builder.sh
+++ b/image-builder/test-image-builder.sh
@@ -75,6 +75,14 @@ MIRROR="file://$tmp/mnt"
MIRROR="https://example/x"
( require_mount current ) 2>/dev/null; check_rc "require_mount http skips" 0 $?
+# --- require_docker: stub `docker` so the check never touches a real daemon ---
+docker() { return "${DOCKER_RC:-0}"; }
+DOCKER_RC=1
+( require_docker ) 2>/dev/null; check_rc "require_docker daemon down" 1 $?
+DOCKER_RC=0
+( require_docker ) 2>/dev/null; check_rc "require_docker daemon up" 0 $?
+unset -f docker
+
echo "----"
echo "PASS: $pass FAIL: $fail"
[[ "$fail" -eq 0 ]]