File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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}..."
You can’t perform that action at this time.
0 commit comments