Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
| container:harbor:start [2025/12/19 14:05] – sborne | container:harbor:start [2025/12/22 13:05] (aktuell) – sborne | ||
|---|---|---|---|
| Zeile 9: | Zeile 9: | ||
| ---- | ---- | ||
| - | ====== 1 - Installation | + | ====== 1 - Vorbereitungen |
| + | |||
| + | Es sind mehrere vorbereitende Schritte notwendig. | ||
| + | |||
| + | ===== 1.1 - SSL-Zertifikate ===== | ||
| + | |||
| + | Der Harbor bringt selbst keine Zertifikate mit. Diese müssen manuell erstellt oder von Drittanbietern besorgt werden. Eine Methode zum Erstellen eines eigenen Zertifikats ist [[: | ||
| + | |||
| + | ===== 1.2 - Docker ===== | ||
| + | |||
| + | Harbor läuft als Docker-Container. Dieses Programm muss als Voraussetzung installiert werden. Docker kann aus den Repositories installiert werden, sofern die Docker-Repositories eingebunden wurden: | ||
| + | < | ||
| + | |||
| + | ~# apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin | ||
| + | |||
| + | </ | ||
| + | |||
| + | ===== 1.3 - Harbor | ||
| Harbor kann von der Seite " | Harbor kann von der Seite " | ||
| - | ===== 1.1 - Herunterladen | + | **Schritt |
| < | < | ||
| Zeile 33: | Zeile 50: | ||
| </ | </ | ||
| - | + | **Schritt | |
| - | + | ||
| - | ===== 1.2 - Archiv entpacken ===== | + | |
| < | < | ||
| ~# tar xzvf harbor-offline-installer-v2.14.1.tgz | ~# tar xzvf harbor-offline-installer-v2.14.1.tgz | ||
| - | harbor/ | + | harbor/ |
| - | harbor/ | + | harbor/ |
| - | harbor/ | + | harbor/ |
| - | harbor/ | + | harbor/ |
| - | harbor/ | + | harbor/ |
| harbor/ | harbor/ | ||
| ~# | ~# | ||
| Zeile 49: | Zeile 64: | ||
| </ | </ | ||
| + | ===== 1.4 - Zertifikat ===== | ||
| + | Das zum Server erstellte Zertifikat muss für Harbor und Docker bereitgestellt werden. | ||
| - | ===== 1.3 - Verschlüsselung ===== | + | ==== 1.4.1 - Harbor |
| - | Der Harbor | + | Für Harbor |
| - | \\ | + | **Schritt 1**: Erstellen der Verzeichnisstruktur: |
| + | < | ||
| + | ~# mkdir -pv / | ||
| + | mkdir: Verzeichnis '/ | ||
| - | \\ | + | ~# |
| - | ==== 1.3.1 - Let' | + | </ |
| - | [[https://letsencrypt.org/|Let's Encrypt]] bietet aktuell noch kostenlose Zertifikate an. Leider war es mir in einem ersten Versuch nicht möglich, mittels des Programmes " | + | **Schritt 2**: Kopieren der Zertifikatsdateien: |
| + | < | ||
| + | ~# cp -v slxharbor.fritz.box.crt | ||
| + | 'slxharbor.fritz.box.crt' | ||
| + | ' | ||
| + | ~# | ||
| - | \\ | + | </ |
| - | \\ | + | ==== 1.4.2 - Docker ==== |
| - | ==== 1.3.2 - Eigenes | + | Docker interpretiert "'' |
| - | Es wird ein eigenes Zertifikat erstllt. | + | **Schritt 1**: Konvertieren der Datei: |
| + | < | ||
| + | ~# openssl x509 -inform PEM -in slxharbor.fritz.box.crt -out slxharbor.fritz.box.cert | ||
| - | \\ | + | </ |
| - | **Schritt | + | **Schritt |
| < | < | ||
| - | ~# openssl genrsa | + | ~# mkdir -pv / |
| + | mkdir: Verzeichnis '/ | ||
| + | mkdir: Verzeichnis '/ | ||
| + | mkdir: Verzeichnis '/ | ||
| + | ~# | ||
| </ | </ | ||
| + | **Schritt 3**: Kopieren der Zertifikate: | ||
| + | < | ||
| + | ~# cp -v slxharbor.fritz.box.cert / | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ~# | ||
| + | </ | ||
| - | **Schritt | + | **Schritt |
| + | < | ||
| + | ~# systemctl restart docker | ||
| + | ~# | ||
| - | < | ||
| </ | </ | ||
| + | ====== 2 - YAML-Datei ====== | ||
| + | Vor der eigentlichen Installation muss die mitgelieferte YAML-Datei noch bearbeitet werden. Dazu muss die Vorlage "'' | ||
| + | < | ||
| + | ~# cp -v harbor.yml.tmpl harbor.yml\ | ||
| + | ' | ||
| + | ~# | ||
| - | **Schritt 3**: Erstellen des privaten Schlüssels "'' | + | </ |
| + | |||
| + | Jetzt kann die Datei angepasst werden. Folgende Parameter wurden neu gesetzt: | ||
| + | |||
| + | < | ||
| + | hostname: slxharbor.fritz.box | ||
| + | ... | ||
| + | https: | ||
| + | certificate: | ||
| + | private_key: | ||
| + | ... | ||
| + | harbor_admin_password: | ||
| + | ... | ||
| + | database: | ||
| + | password: ******* | ||
| + | ... | ||
| + | data_volume: / | ||
| - | < | ||
| </ | </ | ||
| + | < | ||
| + | ====== 3 - Installation ====== | ||
| + | Jetzt kann das Installationsskript ausgeführt werden: | ||
| - | **Schritt 4**: Generieren einer Zertifikatsanforderung (CSR): | + | < |
| + | ~# ./ | ||
| + | [Step 0]: checking if docker is installed ... | ||
| - | < | + | Note: docker version: 29.1.3 |
| + | [Step 1]: checking docker-compose is installed ... | ||
| + | |||
| + | Note: Docker Compose version v5.0.0 | ||
| + | |||
| + | [Step 2]: loading Harbor images ... | ||
| + | Loaded image: goharbor/ | ||
| + | Loaded image: goharbor/ | ||
| + | Loaded image: goharbor/ | ||
| + | Loaded image: goharbor/ | ||
| + | Loaded image: goharbor/ | ||
| + | Loaded image: goharbor/ | ||
| + | Loaded image: goharbor/ | ||
| + | Loaded image: goharbor/ | ||
| + | Loaded image: goharbor/ | ||
| + | Loaded image: goharbor/ | ||
| + | Loaded image: goharbor/ | ||
| + | Loaded image: goharbor/ | ||
| + | |||
| + | [Step 3]: preparing environment ... | ||
| + | |||
| + | [Step 4]: preparing harbor configs ... | ||
| + | prepare base dir is set to /tmp/harbor | ||
| + | Clearing the configuration file: / | ||
| + | Clearing the configuration file: / | ||
| + | Clearing the configuration file: / | ||
| + | Generated configuration file: / | ||
| + | Generated configuration file: / | ||
| + | Generated configuration file: / | ||
| + | Generated configuration file: / | ||
| + | Generated configuration file: / | ||
| + | Generated configuration file: / | ||
| + | Generated configuration file: / | ||
| + | Generated configuration file: / | ||
| + | Generated configuration file: / | ||
| + | Generated configuration file: / | ||
| + | Generated configuration file: / | ||
| + | Generated configuration file: / | ||
| + | copy / | ||
| + | ca file / | ||
| + | copy to shared trust ca dir as name storage_ca_bundle.crt ... | ||
| + | copy None to shared trust ca dir as name redis_tls_ca.crt ... | ||
| + | Generated and saved secret to file: / | ||
| + | Successfully called func: create_root_cert | ||
| + | Generated configuration file: / | ||
| + | Clean up the input dir | ||
| + | |||
| + | Note: stopping existing Harbor instance ... | ||
| + | |||
| + | [Step 5]: starting Harbor ... | ||
| + | [+] up 10/10 | ||
| + | ✔ Network harbor_harbor | ||
| + | ✔ Container harbor-log | ||
| + | ✔ Container harbor-db | ||
| + | ✔ Container registry | ||
| + | ✔ Container harbor-portal | ||
| + | ✔ Container registryctl | ||
| + | ✔ Container redis | ||
| + | ✔ Container harbor-core | ||
| + | ✔ Container harbor-jobservice Created | ||
| + | ✔ Container nginx | ||
| + | ✔ ----Harbor has been installed and started successfully.---- | ||
| + | ~# | ||
| </ | </ | ||
| + | ====== 4 - Kontrolle ====== | ||
| + | Am Ende der Installation wurde angezeigt, dass die Installation erfolgreich war und Harbor gestartet wurde. Dies lässt sich jetzt auf mehrere Arten kontrollieren. | ||
| + | ===== 4.1 - Docker-Container ===== | ||
| + | |||
| + | Es kann geprüft werden, welche Docker-Container gerade laufen: | ||
| + | |||
| + | < | ||
| + | ~# docker ps\ | ||
| + | CONTAINER ID | ||
| + | 5a9ec57ad6c9 | ||
| + | b2a1dfeaa584 | ||
| + | 0b74687b2dae | ||
| + | 321d88d3ebcf | ||
| + | e65496140ab3 | ||
| + | 6ebb82ec2e0a | ||
| + | 98b15e84535f | ||
| + | 1ac95fd29a67 | ||
| + | 5254d72818a9 | ||
| + | ~# | ||
| + | |||
| + | </ | ||
| + | |||
| + | ===== 4.2 - Webseite ===== | ||
| + | |||
| + | Auch die Webseite von Harbor sollte jetzt erreichbar sein: [[https:// | ||
| + | |||
| + | {{https:// | ||
| + | |||
| + | \\ | ||
| + | \\ | ||
| + | ====== 5 - Wartung ====== | ||
| + | |||
| + | Die Wartung von Harbor wird zum entsprechenden Zeitpunkt nachgepflegt. | ||
| + | |||
| + | \\ | ||
| + | \\ | ||
| + | ====== 6 - Registrierung einrichten ====== | ||
| + | |||
| + | Am Beispiel von [[https:// | ||
| + | |||
| + | {{https:// | ||
| + | |||
| + | Mit Klick auf "'' | ||
| + | |||
| + | So sollte es dann hinterher aussehen: | ||
| + | |||
| + | {{https:// | ||
| + | |||
| + | \\ | ||
| + | \\ | ||
| + | \\ | ||
| + | \\ | ||
| + | \\\\ | ||
| + | \\ | ||
| ''< | ''< | ||