ci: test job-private Docker daemon
Runner Docker diagnostic / diagnostic (push) Failing after 1m2s
GeoIntel release gates / Compile, test, contracts and builds (pull_request) Failing after 15s
GeoIntel release gates / Python and npm vulnerability policy (pull_request) Successful in 34s
GeoIntel release gates / GIS image, SBOM and container scan (pull_request) Failing after 15s
GeoIntel release gates / AI image, SBOM and container scan (pull_request) Canceled after 13s

This commit is contained in:
ChatGPT MCP
2026-08-28 17:49:59 +00:00
parent 95b10dcecc
commit 2846efb2a0
+36 -48
View File
@@ -11,55 +11,43 @@ permissions:
jobs:
diagnostic:
runs-on: ubuntu-latest
timeout-minutes: 5
timeout-minutes: 10
services:
docker:
image: docker@sha256:7c3e797187e43738220462658f4586572cbd3bf009f728b21e34d9c5c06ce431
env:
DOCKER_TLS_CERTDIR: ""
options: --privileged
env:
DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: ""
steps:
- name: Inspect isolated Docker executor connectivity
- name: Verify job-private Docker daemon
shell: bash
run: |
set -u
echo "DOCKER_HOST=${DOCKER_HOST:-<unset>}"
echo "DOCKER_TLS_VERIFY=${DOCKER_TLS_VERIFY:-<unset>}"
echo "DOCKER_CERT_PATH=${DOCKER_CERT_PATH:-<unset>}"
for socket_path in /var/run/docker.sock /run/user/1000/docker.sock /var/run/user/1000/docker.sock; do
if [[ -S "${socket_path}" ]]; then
echo "socket:${socket_path}=present"
else
echo "socket:${socket_path}=absent"
fi
done
cat /proc/net/route || true
python - <<'PY'
import socket
import struct
names = ("gitea-runner-dind", "docker", "host.docker.internal")
for name in names:
try:
print(f"dns:{name}={socket.gethostbyname(name)}")
except OSError as exc:
print(f"dns:{name}=unresolved:{type(exc).__name__}")
gateway = None
try:
with open("/proc/net/route", encoding="ascii") as handle:
next(handle, None)
for line in handle:
fields = line.split()
if len(fields) >= 3 and fields[1] == "00000000":
gateway = socket.inet_ntoa(struct.pack("<L", int(fields[2], 16)))
set -euo pipefail
echo "DOCKER_HOST=${DOCKER_HOST}"
for attempt in $(seq 1 30); do
if docker info >/tmp/docker-info.txt 2>&1; then
break
except OSError:
pass
if gateway:
print(f"default-gateway={gateway}")
hosts = ["gitea-runner-dind", "docker", "host.docker.internal"]
if gateway:
hosts.append(gateway)
for host in hosts:
for port in (2375, 2376):
try:
with socket.create_connection((host, port), timeout=1.0):
print(f"tcp:{host}:{port}=reachable")
except OSError as exc:
print(f"tcp:{host}:{port}=unreachable:{type(exc).__name__}")
PY
docker version >/tmp/docker-version.txt 2>&1 || true
sed -n '1,40p' /tmp/docker-version.txt
fi
if [[ "$attempt" -eq 30 ]]; then
cat /tmp/docker-info.txt
exit 1
fi
sleep 1
done
docker version
initial_containers="$(docker ps -aq | wc -l)"
echo "initial-containers=${initial_containers}"
test "${initial_containers}" -eq 0
workdir="$(mktemp -d)"
printf 'geo-intel-ci\n' > "${workdir}/proof.txt"
cat > "${workdir}/Dockerfile" <<'EOF'
FROM scratch
COPY proof.txt /proof.txt
EOF
docker build --pull=false -t geointel-runner-diagnostic:local "${workdir}"
docker image inspect geointel-runner-diagnostic:local --format '{{.Id}}'
docker image rm geointel-runner-diagnostic:local >/dev/null