ci: dump docker socket diagnostics when the daemon poll times out

The 30s poll is enough to ride out a slow daemon startup, but not a
runner where the socket isn't mounted at all. Print DOCKER_HOST, the
socket stat, and the verbose `docker info` error on timeout so the
next flaky run tells us whether it's a startup race or a missing
mount.
This commit is contained in:
Graham McIntire 2026-04-19 12:21:39 -05:00
parent d51f545ab7
commit c5436279ed
No known key found for this signature in database
GPG key ID: F4ABF488E6029E59

View file

@ -51,12 +51,25 @@ jobs:
# `docker info` until it responds so the login/build steps
# below don't race the socket and fail with "unable to
# connect to docker".
sock="${DOCKER_HOST:-unix:///var/run/docker.sock}"
echo "Using DOCKER_HOST=${sock}"
for i in $(seq 1 30); do
docker info >/dev/null 2>&1 && exit 0
if docker info >/dev/null 2>&1; then
echo "Docker daemon reachable after ${i}s"
exit 0
fi
echo "Waiting for Docker daemon... ($i/30)"
sleep 1
done
echo "Docker daemon never became reachable" >&2
echo "Docker daemon never became reachable — diagnostics:" >&2
echo "--- ls -l /var/run/docker.sock ---" >&2
ls -l /var/run/docker.sock 2>&1 || true
echo "--- env | grep -i docker ---" >&2
env | grep -i docker 2>&1 || true
echo "--- docker info (verbose) ---" >&2
docker info 2>&1 || true
exit 1
- name: Generate image tag