This commit is contained in:
2025-09-09 16:37:49 -04:00
parent db7d63fe15
commit ba7d6c3620
2 changed files with 48 additions and 11 deletions
+8 -11
View File
@@ -54,19 +54,14 @@ jobs:
LOCAL_REGISTRY="192.168.253.221:3000" LOCAL_REGISTRY="192.168.253.221:3000"
echo "Registry: $LOCAL_REGISTRY" echo "Registry: $LOCAL_REGISTRY"
# Configure Docker to use HTTP for local registry # Note: Docker daemon must be pre-configured for insecure registry
echo '{ # See configure-docker-insecure.md for setup instructions
"insecure-registries": ["'$LOCAL_REGISTRY'"]
}' > $DOCKER_CONFIG/config.json
# Also configure daemon (if we have permissions) echo "Testing registry connectivity..."
sudo mkdir -p /etc/docker 2>/dev/null || true curl -s "http://$LOCAL_REGISTRY/v2/" && echo "✅ Registry accessible via HTTP" || echo "❌ Registry not accessible"
echo '{
"insecure-registries": ["'$LOCAL_REGISTRY'"]
}' | sudo tee /etc/docker/daemon.json >/dev/null 2>&1 || echo "Could not update daemon.json (continuing anyway)"
sudo systemctl reload docker 2>/dev/null || echo "Could not reload docker daemon (continuing anyway)"
# Login to local registry with HTTP # Login to local registry
echo "Attempting login to local registry..."
echo "${{ secrets.token }}" | docker --config $DOCKER_CONFIG login "$LOCAL_REGISTRY" -u "${{ secrets.username }}" --password-stdin echo "${{ secrets.token }}" | docker --config $DOCKER_CONFIG login "$LOCAL_REGISTRY" -u "${{ secrets.username }}" --password-stdin
# Tag images for local registry # Tag images for local registry
@@ -88,6 +83,8 @@ jobs:
fi fi
else else
echo "❌ Local registry push failed" echo "❌ Local registry push failed"
echo "Please run: sudo systemctl restart docker"
echo "And configure /etc/docker/daemon.json with insecure-registries"
docker images | grep nfoguard docker images | grep nfoguard
exit 1 exit 1
fi fi
+40
View File
@@ -0,0 +1,40 @@
# Manual Docker daemon configuration for insecure registry
## 1. Configure Docker daemon to allow HTTP registry
```bash
# On your gitea-lxc host, run this once:
sudo mkdir -p /etc/docker
# Create or update daemon.json
sudo tee /etc/docker/daemon.json > /dev/null << 'EOF'
{
"insecure-registries": ["192.168.253.221:3000"]
}
EOF
# Restart Docker daemon
sudo systemctl restart docker
# Wait for Docker to restart
sleep 5
# Verify Docker is running
sudo systemctl status docker
```
## 2. Test local registry push manually
```bash
# Test login to local registry
docker login 192.168.253.221:3000
# Test push
docker pull hello-world
docker tag hello-world 192.168.253.221:3000/jskala/test:latest
docker push 192.168.253.221:3000/jskala/test:latest
```
## 3. Then run your workflow
After configuring the daemon manually, the workflow should work without needing to modify daemon.json.