fix(ci): replace ip route with hostname -I to find DinD subnet

The runner image does not have iproute2 installed, so `ip route` fails
with exit 127. Use `hostname -I` (available everywhere) to get the
container's own IP and derive the /24 prefix for the DinD port scan.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Thomas SharedInbox
2026-05-24 01:37:11 +02:00
co-authored by Claude Sonnet 4.6
parent 49ad2ff25d
commit 2a92c8766f
+2 -2
View File
@@ -55,8 +55,8 @@ jobs:
# Codeberg's act runner may not register the service container with the
# 'docker' DNS alias. Fall back: scan the local /24 subnet for port 2375.
echo "Docker unreachable via hostname; scanning network for DinD..." >&2
GW=$(ip route | awk '/default/{print $3; exit}')
PREFIX=$(echo "$GW" | cut -d. -f1-3)
MY_IP=$(hostname -I | awk '{print $1}')
PREFIX=$(echo "$MY_IP" | cut -d. -f1-3)
FOUND=""
for i in $(seq 1 50); do
ip="${PREFIX}.${i}"