Skip to content

Commit c58027f

Browse files
committed
fix: skip systemctl restart on DinD runners
1 parent 12b4c76 commit c58027f

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

.github/workflows/docker-build.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,17 @@ jobs:
139139
# Store the cert for later injection into BuildKit
140140
echo "$REGISTRY_CA_CERT" > /tmp/registry-ca.crt
141141
142-
# Restart Docker daemon to pick up new certificates
143-
sudo systemctl restart docker
144-
145-
# Wait for Docker to be ready
146-
sleep 5
147-
docker info > /dev/null 2>&1
142+
# Restart Docker daemon to pick up new certificates (only on systemd hosts)
143+
# DinD runners don't have systemd - certs.d works without restart
144+
if command -v systemctl &>/dev/null && systemctl is-system-running &>/dev/null; then
145+
echo "Restarting Docker daemon..."
146+
sudo systemctl restart docker
147+
sleep 5
148+
docker info > /dev/null 2>&1
149+
else
150+
echo "No systemd available (DinD mode), skipping daemon restart"
151+
# Docker certs.d directory works without restart for registry operations
152+
fi
148153
149154
# Verify TLS connection works
150155
echo "Testing TLS connection to ${REGISTRY_HOST}..."

0 commit comments

Comments
 (0)