games_app/deploy/gitea-stack/configure-docker-insecure-registry.sh
Your Name 07ccda0349
Some checks failed
CI / test-and-build (push) Failing after 1m40s
Fix Gitea Actions registry access and runner config
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-17 20:03:55 +02:00

30 lines
1.0 KiB
Bash

#!/usr/bin/env bash
# Allow HTTP push/pull to local registry from Docker daemon / job containers.
set -euo pipefail
DAEMON=/etc/docker/daemon.json
sudo mkdir -p /etc/docker
if [[ -f "$DAEMON" ]]; then
sudo python3 - <<'PY'
import json
from pathlib import Path
p=Path("/etc/docker/daemon.json")
data=json.loads(p.read_text() or "{}")
regs=set(data.get("insecure-registries") or [])
regs.update(["172.16.0.1:5000", "127.0.0.1:5000"])
data["insecure-registries"]=sorted(regs)
p.write_text(json.dumps(data, indent=2)+"\n")
print(data)
PY
else
echo '{"insecure-registries":["127.0.0.1:5000","172.16.0.1:5000"]}' | sudo tee "$DAEMON"
fi
sudo systemctl restart docker
sleep 3
# restart stacks after docker restart
cd ~/gitea && sudo docker compose up -d gitea registry
sudo docker compose --profile runner up -d runner
cd ~/games_app && sudo docker compose --profile http --profile clamav up -d
curl -fsS http://127.0.0.1:9080/health | head -c 80; echo
curl -fsS http://127.0.0.1:3000/api/v1/version; echo
echo "DOCKER_REGISTRY_OK"