fix: Build CI images on production server
Some checks failed
🚀 Build & Deploy Image / Determine Build Necessity (push) Successful in 33s
Security Vulnerability Scan / Check for Dependency Changes (push) Successful in 39s
🚀 Build & Deploy Image / Build Runtime Base Image (push) Successful in 17s
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Successful in 1m15s
Security Vulnerability Scan / Composer Security Audit (push) Has been skipped
🚀 Build & Deploy Image / Build Docker Image (push) Failing after 33s
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Has been skipped
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been skipped
Some checks failed
🚀 Build & Deploy Image / Determine Build Necessity (push) Successful in 33s
Security Vulnerability Scan / Check for Dependency Changes (push) Successful in 39s
🚀 Build & Deploy Image / Build Runtime Base Image (push) Successful in 17s
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Successful in 1m15s
Security Vulnerability Scan / Composer Security Audit (push) Has been skipped
🚀 Build & Deploy Image / Build Docker Image (push) Failing after 33s
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Has been skipped
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been skipped
- Add build-ci-image-production.sh script for building CI images on production - Add BUILD_ON_PRODUCTION.md documentation - Fix Dockerfile to handle optional PECL extensions for PHP 8.5 RC This fixes the issue where Gitea workflows fail with: 'Error response from daemon: pull access denied for php-ci'
This commit is contained in:
92
deployment/gitea-runner/BUILD_ON_PRODUCTION.md
Normal file
92
deployment/gitea-runner/BUILD_ON_PRODUCTION.md
Normal file
@@ -0,0 +1,92 @@
|
||||
# CI Image auf Produktionsserver bauen
|
||||
|
||||
## Problem
|
||||
|
||||
Der Gitea Runner auf dem Produktionsserver versucht, das `php-ci:latest` Image zu pullen, aber es existiert nicht in der Registry oder lokal. Der Fehler lautet:
|
||||
|
||||
```
|
||||
Error response from daemon: pull access denied for php-ci, repository does not exist or may require 'docker login'
|
||||
```
|
||||
|
||||
## Lösung: Image direkt auf dem Produktionsserver bauen
|
||||
|
||||
### Schritt 1: Auf den Produktionsserver verbinden
|
||||
|
||||
```bash
|
||||
ssh user@production-server
|
||||
```
|
||||
|
||||
### Schritt 2: Zum Projektverzeichnis wechseln
|
||||
|
||||
```bash
|
||||
cd /path/to/michaelschiemer
|
||||
```
|
||||
|
||||
### Schritt 3: CI Image bauen
|
||||
|
||||
```bash
|
||||
cd deployment/gitea-runner
|
||||
./build-ci-image-production.sh
|
||||
```
|
||||
|
||||
Das Script:
|
||||
- Baut das `php-ci:latest` Image
|
||||
- Baut das `docker-build:latest` Image
|
||||
- Lädt beide Images in den `gitea-runner-dind` Container
|
||||
|
||||
### Schritt 4: Verifikation
|
||||
|
||||
1. **Prüfe ob Images gebaut wurden:**
|
||||
```bash
|
||||
docker images | grep -E "php-ci|docker-build"
|
||||
```
|
||||
|
||||
2. **Prüfe ob Images in docker-dind geladen wurden:**
|
||||
```bash
|
||||
docker exec gitea-runner-dind docker images | grep -E "php-ci|docker-build"
|
||||
```
|
||||
|
||||
3. **Prüfe Runner Labels in Gitea UI:**
|
||||
- Gehe zu: https://git.michaelschiemer.de/admin/actions/runners
|
||||
- Der Runner sollte das `php-ci` Label zeigen
|
||||
|
||||
4. **Teste einen Workflow:**
|
||||
- Ein Workflow mit `runs-on: php-ci` sollte jetzt funktionieren
|
||||
|
||||
## Alternative: Ansible Playbook verwenden
|
||||
|
||||
Falls Ansible auf dem Produktionsserver verfügbar ist:
|
||||
|
||||
```bash
|
||||
cd deployment/ansible
|
||||
ansible-playbook -i inventory/production.yml \
|
||||
playbooks/setup-gitea-runner-ci.yml \
|
||||
-e "project_root=/path/to/michaelschiemer"
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
**Image wird nicht in docker-dind gefunden:**
|
||||
- Stelle sicher, dass `gitea-runner-dind` läuft: `docker ps | grep docker-dind`
|
||||
- Lade das Image manuell: `docker save php-ci:latest | docker exec -i gitea-runner-dind docker load`
|
||||
|
||||
**Runner zeigt php-ci Label nicht:**
|
||||
- Labels können nur bei der Registration geändert werden
|
||||
- Runner neu registrieren:
|
||||
```bash
|
||||
cd deployment/gitea-runner
|
||||
./unregister.sh
|
||||
./register.sh
|
||||
```
|
||||
|
||||
**Build schlägt fehl:**
|
||||
- Prüfe Docker-Logs: `docker logs gitea-runner-dind`
|
||||
- Stelle sicher, dass genug Speicherplatz vorhanden ist: `df -h`
|
||||
- Prüfe Docker-Daemon: `docker info`
|
||||
|
||||
## Hinweise
|
||||
|
||||
- Das Image ist ca. 1.85GB groß - der Build kann einige Minuten dauern
|
||||
- Stelle sicher, dass genug Speicherplatz auf dem Server vorhanden ist
|
||||
- Das Image wird lokal gebaut und muss nicht in die Registry gepusht werden (wird direkt in docker-dind geladen)
|
||||
|
||||
Reference in New Issue
Block a user