Initial Commit
This commit is contained in:
114
01 docker-basics.md
Normal file
114
01 docker-basics.md
Normal file
@@ -0,0 +1,114 @@
|
|||||||
|
# Vortrags-Script: Docker Basics
|
||||||
|
|
||||||
|
## Einführung
|
||||||
|
|
||||||
|
### Container vs. VM
|
||||||
|
- **Virtuelle Maschinen**: Eigenes Betriebssystem, Hypervisor, hoher Ressourcenverbrauch
|
||||||
|
- **Container**: Teilen Kernel des Host-Systems, leichtgewichtige Isolation, schneller Start
|
||||||
|
|
||||||
|
### Docker-Architektur
|
||||||
|
- **Docker-Client**: CLI-Tool für Interaktion
|
||||||
|
```bash
|
||||||
|
docker version
|
||||||
|
docker info
|
||||||
|
```
|
||||||
|
- **Docker-Daemon**: Hintergrundprozess, verwaltet Container und Images
|
||||||
|
- **Docker-Registry**: Repository für Images
|
||||||
|
```bash
|
||||||
|
docker search nginx
|
||||||
|
```
|
||||||
|
|
||||||
|
### Images und Container
|
||||||
|
- **Image**: Unveränderbare Vorlage
|
||||||
|
```bash
|
||||||
|
docker images
|
||||||
|
```
|
||||||
|
- **Container**: Laufende Instanz eines Images
|
||||||
|
```bash
|
||||||
|
docker ps
|
||||||
|
```
|
||||||
|
|
||||||
|
## Docker-Images
|
||||||
|
|
||||||
|
### Image-Aufbau
|
||||||
|
- Layer-Architektur: Jede Anweisung erzeugt neue Schicht
|
||||||
|
```bash
|
||||||
|
docker history nginx
|
||||||
|
```
|
||||||
|
- Cache-Nutzung bei Build-Prozessen
|
||||||
|
- Basis-Images als Fundament
|
||||||
|
```bash
|
||||||
|
docker pull php:8.1-fpm
|
||||||
|
```
|
||||||
|
|
||||||
|
### Dockerfile-Syntax
|
||||||
|
```dockerfile
|
||||||
|
FROM php:8.1-fpm
|
||||||
|
WORKDIR /var/www/html
|
||||||
|
COPY composer.json composer.lock ./
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
zip \
|
||||||
|
unzip \
|
||||||
|
&& docker-php-ext-install pdo pdo_mysql
|
||||||
|
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
||||||
|
RUN composer install --no-scripts --no-autoloader
|
||||||
|
COPY . .
|
||||||
|
RUN composer dump-autoload --optimize
|
||||||
|
EXPOSE 9000
|
||||||
|
CMD ["php-fpm"]
|
||||||
|
```
|
||||||
|
|
||||||
|
### Build-Prozess
|
||||||
|
```bash
|
||||||
|
docker build -t mein-projekt:1.0 .
|
||||||
|
docker build -t mein-projekt:1.0 -f Dockerfile.prod .
|
||||||
|
docker build --no-cache -t mein-projekt:1.0 .
|
||||||
|
```
|
||||||
|
|
||||||
|
### Image-Registry
|
||||||
|
```bash
|
||||||
|
docker login
|
||||||
|
docker tag mein-projekt:1.0 username/mein-projekt:1.0
|
||||||
|
docker push username/mein-projekt:1.0
|
||||||
|
docker pull username/mein-projekt:1.0
|
||||||
|
```
|
||||||
|
|
||||||
|
## Container-Lebenszyklus
|
||||||
|
|
||||||
|
### Starten, Stoppen, Löschen
|
||||||
|
```bash
|
||||||
|
docker run -d --name web mein-projekt:1.0
|
||||||
|
docker run -it --rm ubuntu bash
|
||||||
|
docker stop web
|
||||||
|
docker start web
|
||||||
|
docker restart web
|
||||||
|
docker rm web
|
||||||
|
docker rm -f web
|
||||||
|
docker ps
|
||||||
|
docker ps -a
|
||||||
|
```
|
||||||
|
|
||||||
|
### Container-Isolation
|
||||||
|
```bash
|
||||||
|
docker inspect web
|
||||||
|
docker stats web
|
||||||
|
```
|
||||||
|
|
||||||
|
### Ports und Netzwerke
|
||||||
|
```bash
|
||||||
|
docker run -d -p 8080:80 nginx
|
||||||
|
docker network ls
|
||||||
|
docker network create app-netz
|
||||||
|
docker run -d --network app-netz --name db mysql:8.0
|
||||||
|
docker network inspect app-netz
|
||||||
|
```
|
||||||
|
|
||||||
|
### Volumes für Datenpersistenz
|
||||||
|
```bash
|
||||||
|
docker volume ls
|
||||||
|
docker volume create data-volume
|
||||||
|
docker run -v $(pwd):/var/www/html nginx
|
||||||
|
docker run -v data-volume:/var/lib/mysql mysql:8.0
|
||||||
|
docker run --tmpfs /tmp nginx
|
||||||
|
docker volume inspect data-volume
|
||||||
|
```
|
||||||
31
02 docker-basics-uebungen.md
Normal file
31
02 docker-basics-uebungen.md
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
# 10 Praktische Docker-Übungen
|
||||||
|
|
||||||
|
## Übung 1: Ersten Container starten
|
||||||
|
**Aufgabe:** Starte einen Nginx-Webserver als Container und prüfe, ob er unter http://localhost:8080 erreichbar ist.
|
||||||
|
|
||||||
|
## Übung 2: Container-Inspektion
|
||||||
|
**Aufgabe:** Starte einen PHP-Container, führe eine Shell darin aus und ermittle die PHP-Version.
|
||||||
|
|
||||||
|
## Übung 3: Einfaches Dockerfile erstellen
|
||||||
|
**Aufgabe:** Erstelle ein Dockerfile für eine PHP-Anwendung, die GD-Extension benötigt.
|
||||||
|
|
||||||
|
## Übung 4: Image bauen und taggen
|
||||||
|
**Aufgabe:** Baue ein Image aus dem Dockerfile der Übung 3, tagge es mit deinem Namen und Version 1.0.
|
||||||
|
|
||||||
|
## Übung 5: Container mit Volumes
|
||||||
|
**Aufgabe:** Starte einen MySQL-Container mit einem Named Volume für Datenpersistenz.
|
||||||
|
|
||||||
|
## Übung 6: Bind Mount für Entwicklung
|
||||||
|
**Aufgabe:** Starte einen PHP-Container, der das aktuelle Verzeichnis als Bind Mount nutzt.
|
||||||
|
|
||||||
|
## Übung 7: Container-Netzwerk erstellen
|
||||||
|
**Aufgabe:** Erstelle ein Netzwerk und verbinde einen PHP- und MySQL-Container.
|
||||||
|
|
||||||
|
## Übung 8: Multi-Stage Build
|
||||||
|
**Aufgabe:** Erstelle ein Dockerfile für eine React-App mit Multi-Stage Build.
|
||||||
|
|
||||||
|
## Übung 9: Image in Docker Hub pushen
|
||||||
|
**Aufgabe:** Tagge ein Image für Docker Hub und pushe es in dein Repository.
|
||||||
|
|
||||||
|
## Übung 10: Container-Ressourcen begrenzen
|
||||||
|
**Aufgabe:** Starte einen Container mit begrenztem Speicher und CPU.
|
||||||
137
03 docker-basics-uebungen-mit-loesung.md
Normal file
137
03 docker-basics-uebungen-mit-loesung.md
Normal file
@@ -0,0 +1,137 @@
|
|||||||
|
# 10 Praktische Docker-Übungen
|
||||||
|
|
||||||
|
## Übung 1: Ersten Container starten
|
||||||
|
**Aufgabe:** Starte einen Nginx-Webserver als Container und prüfe, ob er unter http://localhost:8080 erreichbar ist.
|
||||||
|
|
||||||
|
**Lösung:**
|
||||||
|
```bash
|
||||||
|
docker run -d --name webserver -p 8080:80 nginx
|
||||||
|
curl http://localhost:8080
|
||||||
|
```
|
||||||
|
|
||||||
|
## Übung 2: Container-Inspektion
|
||||||
|
**Aufgabe:** Starte einen PHP-Container, führe eine Shell darin aus und ermittle die PHP-Version.
|
||||||
|
|
||||||
|
**Lösung:**
|
||||||
|
```bash
|
||||||
|
docker run -d --name php-test php:8.1-cli
|
||||||
|
docker exec -it php-test bash
|
||||||
|
php -v
|
||||||
|
exit
|
||||||
|
```
|
||||||
|
|
||||||
|
## Übung 3: Einfaches Dockerfile erstellen
|
||||||
|
**Aufgabe:** Erstelle ein Dockerfile für eine PHP-Anwendung, die GD-Extension benötigt.
|
||||||
|
|
||||||
|
**Lösung:**
|
||||||
|
```dockerfile
|
||||||
|
FROM php:8.1-cli
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
libfreetype6-dev \
|
||||||
|
libjpeg62-turbo-dev \
|
||||||
|
libpng-dev \
|
||||||
|
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
|
||||||
|
&& docker-php-ext-install -j$(nproc) gd
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
COPY . .
|
||||||
|
CMD ["php", "-S", "0.0.0.0:8000"]
|
||||||
|
```
|
||||||
|
|
||||||
|
## Übung 4: Image bauen und taggen
|
||||||
|
**Aufgabe:** Baue ein Image aus dem Dockerfile der Übung 3, tagge es mit deinem Namen und Version 1.0.
|
||||||
|
|
||||||
|
**Lösung:**
|
||||||
|
```bash
|
||||||
|
docker build -t {name}/php-app:1.0 .
|
||||||
|
docker images | grep {name}/php-app
|
||||||
|
```
|
||||||
|
|
||||||
|
## Übung 5: Container mit Volumes
|
||||||
|
**Aufgabe:** Starte einen MySQL-Container mit einem Named Volume für Datenpersistenz.
|
||||||
|
|
||||||
|
**Lösung:**
|
||||||
|
```bash
|
||||||
|
docker volume create mysql-data
|
||||||
|
docker run -d --name mysql-db \
|
||||||
|
-e MYSQL_ROOT_PASSWORD=secret \
|
||||||
|
-e MYSQL_DATABASE=testdb \
|
||||||
|
-v mysql-data:/var/lib/mysql \
|
||||||
|
mysql:8.0
|
||||||
|
```
|
||||||
|
|
||||||
|
## Übung 6: Bind Mount für Entwicklung
|
||||||
|
**Aufgabe:** Starte einen PHP-Container, der das aktuelle Verzeichnis als Bind Mount nutzt.
|
||||||
|
|
||||||
|
**Lösung:**
|
||||||
|
```bash
|
||||||
|
echo "<?php phpinfo();" > index.php
|
||||||
|
docker run -d --name php-dev -p 8000:8000 \
|
||||||
|
-v $(pwd):/app \
|
||||||
|
php:8.1-cli \
|
||||||
|
php -S 0.0.0.0:8000 -t /app
|
||||||
|
```
|
||||||
|
|
||||||
|
## Übung 7: Container-Netzwerk erstellen
|
||||||
|
**Aufgabe:** Erstelle ein Netzwerk und verbinde einen PHP- und MySQL-Container.
|
||||||
|
|
||||||
|
**Lösung:**
|
||||||
|
```bash
|
||||||
|
docker network create app-network
|
||||||
|
docker run -d --name mysql-db \
|
||||||
|
--network app-network \
|
||||||
|
-e MYSQL_ROOT_PASSWORD=secret \
|
||||||
|
-e MYSQL_DATABASE=testdb \
|
||||||
|
mysql:8.0
|
||||||
|
|
||||||
|
docker run -d --name php-app \
|
||||||
|
--network app-network \
|
||||||
|
php:8.1-cli \
|
||||||
|
php -r "while(true){echo 'Connected to MySQL: '.var_export(mysqli_connect('mysql-db', 'root', 'secret', 'testdb') !== false, true).PHP_EOL; sleep(5);}"
|
||||||
|
|
||||||
|
docker logs php-app
|
||||||
|
```
|
||||||
|
|
||||||
|
## Übung 8: Multi-Stage Build
|
||||||
|
**Aufgabe:** Erstelle ein Dockerfile für eine React-App mit Multi-Stage Build.
|
||||||
|
|
||||||
|
**Lösung:**
|
||||||
|
```dockerfile
|
||||||
|
# Build-Stage
|
||||||
|
FROM node:16 AS build
|
||||||
|
WORKDIR /app
|
||||||
|
COPY package*.json ./
|
||||||
|
RUN npm install
|
||||||
|
COPY . .
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
# Production-Stage
|
||||||
|
FROM nginx:alpine
|
||||||
|
COPY --from=build /app/build /usr/share/nginx/html
|
||||||
|
EXPOSE 80
|
||||||
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
|
```
|
||||||
|
|
||||||
|
## Übung 9: Image in Docker Hub pushen
|
||||||
|
**Aufgabe:** Tagge ein Image für Docker Hub und pushe es in dein Repository.
|
||||||
|
|
||||||
|
**Lösung:**
|
||||||
|
```bash
|
||||||
|
docker login
|
||||||
|
docker tag {name}/php-app:1.0 {dockerhub-username}/php-app:1.0
|
||||||
|
docker push {dockerhub-username}/php-app:1.0
|
||||||
|
```
|
||||||
|
|
||||||
|
## Übung 10: Container-Ressourcen begrenzen
|
||||||
|
**Aufgabe:** Starte einen Container mit begrenztem Speicher und CPU.
|
||||||
|
|
||||||
|
**Lösung:**
|
||||||
|
```bash
|
||||||
|
docker run -d --name limited-container \
|
||||||
|
--memory=512m \
|
||||||
|
--cpus=0.5 \
|
||||||
|
php:8.1-cli \
|
||||||
|
php -r "while(true){echo memory_get_usage().PHP_EOL; sleep(1);}"
|
||||||
|
|
||||||
|
docker stats limited-container
|
||||||
|
```
|
||||||
148
04 docker-compose-basics.md
Normal file
148
04 docker-compose-basics.md
Normal file
@@ -0,0 +1,148 @@
|
|||||||
|
# Vortrags-Script: Docker Compose Basics
|
||||||
|
|
||||||
|
## Einführung Docker Compose
|
||||||
|
|
||||||
|
### Zweck und Vorteile
|
||||||
|
- **Definition**: Tool zur Verwaltung mehrerer Container als Anwendung
|
||||||
|
- **Installation prüfen**:
|
||||||
|
```bash
|
||||||
|
docker-compose --version
|
||||||
|
```
|
||||||
|
|
||||||
|
### YAML-Syntax
|
||||||
|
```yaml
|
||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
web:
|
||||||
|
image: nginx
|
||||||
|
ports:
|
||||||
|
- "8080:80"
|
||||||
|
db:
|
||||||
|
image: mysql:8.0
|
||||||
|
environment:
|
||||||
|
MYSQL_ROOT_PASSWORD: secret
|
||||||
|
```
|
||||||
|
|
||||||
|
### Grundbefehle
|
||||||
|
```bash
|
||||||
|
docker-compose up
|
||||||
|
docker-compose up -d
|
||||||
|
docker-compose down
|
||||||
|
docker-compose ps
|
||||||
|
docker-compose logs
|
||||||
|
docker-compose logs -f web
|
||||||
|
```
|
||||||
|
|
||||||
|
## Mehrcontainer-Anwendungen
|
||||||
|
|
||||||
|
### Service-Abhängigkeiten
|
||||||
|
```yaml
|
||||||
|
services:
|
||||||
|
web:
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker-compose up -d db
|
||||||
|
docker-compose up -d web
|
||||||
|
```
|
||||||
|
|
||||||
|
### Umgebungsvariablen
|
||||||
|
```bash
|
||||||
|
echo "DB_PASSWORD=secret" > .env
|
||||||
|
docker-compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
### Netzwerke zwischen Containern
|
||||||
|
```bash
|
||||||
|
docker-compose exec web ping db
|
||||||
|
docker network ls
|
||||||
|
docker network inspect <project_name>_default
|
||||||
|
```
|
||||||
|
|
||||||
|
## Docker Compose in Entwicklung
|
||||||
|
|
||||||
|
### Hot-Reloading
|
||||||
|
```bash
|
||||||
|
docker-compose exec web ls -la /var/www/html
|
||||||
|
# Änderung an lokaler Datei vornehmen
|
||||||
|
docker-compose exec web cat /var/www/html/index.php
|
||||||
|
```
|
||||||
|
|
||||||
|
### Debugging
|
||||||
|
```bash
|
||||||
|
docker-compose logs -f
|
||||||
|
docker-compose exec web bash
|
||||||
|
docker-compose exec -T web php -v
|
||||||
|
```
|
||||||
|
|
||||||
|
### Ressourcenkontrolle
|
||||||
|
```bash
|
||||||
|
docker stats $(docker-compose ps -q)
|
||||||
|
```
|
||||||
|
|
||||||
|
## Zusammenfassung und Beispiel
|
||||||
|
|
||||||
|
### Komplettes Beispiel: LAMP-Stack
|
||||||
|
```yaml
|
||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
web:
|
||||||
|
build: ./php
|
||||||
|
ports:
|
||||||
|
- "8000:80"
|
||||||
|
volumes:
|
||||||
|
- ./src:/var/www/html
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
environment:
|
||||||
|
DB_HOST: db
|
||||||
|
DB_USER: app
|
||||||
|
DB_PASSWORD: secret
|
||||||
|
DB_NAME: myapp
|
||||||
|
|
||||||
|
db:
|
||||||
|
image: mysql:8.0
|
||||||
|
volumes:
|
||||||
|
- db-data:/var/lib/mysql
|
||||||
|
environment:
|
||||||
|
MYSQL_ROOT_PASSWORD: rootsecret
|
||||||
|
MYSQL_DATABASE: myapp
|
||||||
|
MYSQL_USER: app
|
||||||
|
MYSQL_PASSWORD: secret
|
||||||
|
|
||||||
|
phpmyadmin:
|
||||||
|
image: phpmyadmin/phpmyadmin
|
||||||
|
ports:
|
||||||
|
- "8080:80"
|
||||||
|
environment:
|
||||||
|
PMA_HOST: db
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
db-data:
|
||||||
|
```
|
||||||
|
|
||||||
|
### Praktische Befehle
|
||||||
|
```bash
|
||||||
|
# Alle Container starten
|
||||||
|
docker-compose up -d
|
||||||
|
|
||||||
|
# Status prüfen
|
||||||
|
docker-compose ps
|
||||||
|
|
||||||
|
# Service neu erstellen und starten
|
||||||
|
docker-compose up -d --force-recreate web
|
||||||
|
|
||||||
|
# Logs überwachen
|
||||||
|
docker-compose logs -f
|
||||||
|
|
||||||
|
# Alles herunterfahren und aufräumen
|
||||||
|
docker-compose down -v --remove-orphans
|
||||||
|
|
||||||
|
# Neu bauen und starten
|
||||||
|
docker-compose build --no-cache
|
||||||
|
docker-compose up -d
|
||||||
|
```
|
||||||
31
05 docker-compose-uebungen.md
Normal file
31
05 docker-compose-uebungen.md
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
# 10 Praktische Docker Compose Übungen
|
||||||
|
|
||||||
|
## Übung 1: Einfaches Compose-File erstellen
|
||||||
|
**Aufgabe:** Erstelle ein docker-compose.yml für einen Webserver (Nginx) und stelle sicher, dass er auf Port 8080 erreichbar ist.
|
||||||
|
|
||||||
|
## Übung 2: Multi-Service Anwendung
|
||||||
|
**Aufgabe:** Erstelle ein Compose-File für eine PHP-Anwendung mit Nginx und MySQL-Datenbank.
|
||||||
|
|
||||||
|
## Übung 3: Volume-Konfiguration
|
||||||
|
**Aufgabe:** Erweitere das Setup aus Übung 2 um ein benanntes Volume für die Datenbank.
|
||||||
|
|
||||||
|
## Übung 4: Netzwerk-Konfiguration
|
||||||
|
**Aufgabe:** Erstelle eine Compose-Konfiguration mit zwei separaten Netzwerken: frontend (für Nginx und PHP-FPM) und backend (für PHP-FPM und Datenbank).
|
||||||
|
|
||||||
|
## Übung 5: Umgebungsvariablen
|
||||||
|
**Aufgabe:** Erstelle ein Compose-File, das Umgebungsvariablen aus einer .env-Datei verwendet.
|
||||||
|
|
||||||
|
## Übung 6: Service-Abhängigkeiten
|
||||||
|
**Aufgabe:** Konfiguriere ein Compose-Setup mit drei Services (Backend mit PHP-FPM und Nginx, Frontend, DB), wobei Backend von DB abhängt und Frontend von Backend.
|
||||||
|
|
||||||
|
## Übung 7: Build-Konfiguration
|
||||||
|
**Aufgabe:** Erstelle ein Compose-File mit einem Service, der aus einem lokalen Dockerfile gebaut wird.
|
||||||
|
|
||||||
|
## Übung 8: Service-Skalierung
|
||||||
|
**Aufgabe:** Konfiguriere ein Compose-Setup, bei dem der Nginx-Service auf 3 Instanzen skaliert werden kann.
|
||||||
|
|
||||||
|
## Übung 9: Override-Konfiguration
|
||||||
|
**Aufgabe:** Erstelle eine Basis-Compose-Datei und eine Entwicklungs-Override-Datei.
|
||||||
|
|
||||||
|
## Übung 10: Debugging-Setup
|
||||||
|
**Aufgabe:** Erstelle ein Compose-Setup für PHP-FPM mit Nginx und Xdebug-Unterstützung.
|
||||||
372
06 docker-compose-uebungen-mit-loesung.md
Normal file
372
06 docker-compose-uebungen-mit-loesung.md
Normal file
@@ -0,0 +1,372 @@
|
|||||||
|
# 10 Praktische Docker Compose Übungen
|
||||||
|
|
||||||
|
## Übung 1: Einfaches Compose-File erstellen
|
||||||
|
**Aufgabe:** Erstelle ein docker-compose.yml für einen Webserver (Nginx) und stelle sicher, dass er auf Port 8080 erreichbar ist.
|
||||||
|
|
||||||
|
**Lösung:**
|
||||||
|
```yaml
|
||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
web:
|
||||||
|
image: nginx
|
||||||
|
ports:
|
||||||
|
- "8080:80"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Übung 2: Multi-Service Anwendung
|
||||||
|
**Aufgabe:** Erstelle ein Compose-File für eine PHP-Anwendung mit Nginx und MySQL-Datenbank.
|
||||||
|
|
||||||
|
**Lösung:**
|
||||||
|
```yaml
|
||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
nginx:
|
||||||
|
image: nginx
|
||||||
|
ports:
|
||||||
|
- "8000:80"
|
||||||
|
volumes:
|
||||||
|
- ./src:/var/www/html
|
||||||
|
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
|
||||||
|
depends_on:
|
||||||
|
- php
|
||||||
|
|
||||||
|
php:
|
||||||
|
image: php:8.1-fpm
|
||||||
|
volumes:
|
||||||
|
- ./src:/var/www/html
|
||||||
|
|
||||||
|
db:
|
||||||
|
image: mysql:8.0
|
||||||
|
environment:
|
||||||
|
MYSQL_ROOT_PASSWORD: root
|
||||||
|
MYSQL_DATABASE: app
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
# ./nginx/default.conf
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
index index.php index.html;
|
||||||
|
server_name localhost;
|
||||||
|
root /var/www/html;
|
||||||
|
|
||||||
|
location ~ \.php$ {
|
||||||
|
fastcgi_pass php:9000;
|
||||||
|
fastcgi_index index.php;
|
||||||
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
|
include fastcgi_params;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Übung 3: Volume-Konfiguration
|
||||||
|
**Aufgabe:** Erweitere das Setup aus Übung 2 um ein benanntes Volume für die Datenbank.
|
||||||
|
|
||||||
|
**Lösung:**
|
||||||
|
```yaml
|
||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
nginx:
|
||||||
|
image: nginx
|
||||||
|
ports:
|
||||||
|
- "8000:80"
|
||||||
|
volumes:
|
||||||
|
- ./src:/var/www/html
|
||||||
|
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
|
||||||
|
depends_on:
|
||||||
|
- php
|
||||||
|
|
||||||
|
php:
|
||||||
|
image: php:8.1-fpm
|
||||||
|
volumes:
|
||||||
|
- ./src:/var/www/html
|
||||||
|
|
||||||
|
db:
|
||||||
|
image: mysql:8.0
|
||||||
|
environment:
|
||||||
|
MYSQL_ROOT_PASSWORD: root
|
||||||
|
MYSQL_DATABASE: app
|
||||||
|
volumes:
|
||||||
|
- db-data:/var/lib/mysql
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
db-data:
|
||||||
|
```
|
||||||
|
|
||||||
|
## Übung 4: Netzwerk-Konfiguration
|
||||||
|
**Aufgabe:** Erstelle eine Compose-Konfiguration mit zwei separaten Netzwerken: frontend (für Nginx und PHP-FPM) und backend (für PHP-FPM und Datenbank).
|
||||||
|
|
||||||
|
**Lösung:**
|
||||||
|
```yaml
|
||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
nginx:
|
||||||
|
image: nginx
|
||||||
|
ports:
|
||||||
|
- "8080:80"
|
||||||
|
volumes:
|
||||||
|
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
|
||||||
|
networks:
|
||||||
|
- frontend
|
||||||
|
depends_on:
|
||||||
|
- php
|
||||||
|
|
||||||
|
php:
|
||||||
|
image: php:8.1-fpm
|
||||||
|
volumes:
|
||||||
|
- ./src:/var/www/html
|
||||||
|
networks:
|
||||||
|
- frontend
|
||||||
|
- backend
|
||||||
|
|
||||||
|
db:
|
||||||
|
image: mysql:8.0
|
||||||
|
environment:
|
||||||
|
MYSQL_ROOT_PASSWORD: root
|
||||||
|
networks:
|
||||||
|
- backend
|
||||||
|
|
||||||
|
networks:
|
||||||
|
frontend:
|
||||||
|
backend:
|
||||||
|
internal: true
|
||||||
|
```
|
||||||
|
|
||||||
|
## Übung 5: Umgebungsvariablen
|
||||||
|
**Aufgabe:** Erstelle ein Compose-File, das Umgebungsvariablen aus einer .env-Datei verwendet.
|
||||||
|
|
||||||
|
**Lösung:**
|
||||||
|
```yaml
|
||||||
|
# docker-compose.yml
|
||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
nginx:
|
||||||
|
image: nginx
|
||||||
|
ports:
|
||||||
|
- "${WEB_PORT:-8000}:80"
|
||||||
|
volumes:
|
||||||
|
- ./src:/var/www/html
|
||||||
|
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
|
||||||
|
depends_on:
|
||||||
|
- php
|
||||||
|
|
||||||
|
php:
|
||||||
|
image: php:8.1-fpm
|
||||||
|
volumes:
|
||||||
|
- ./src:/var/www/html
|
||||||
|
environment:
|
||||||
|
DB_HOST: db
|
||||||
|
DB_NAME: ${DB_NAME}
|
||||||
|
DB_USER: ${DB_USER}
|
||||||
|
DB_PASS: ${DB_PASS}
|
||||||
|
|
||||||
|
db:
|
||||||
|
image: mysql:8.0
|
||||||
|
environment:
|
||||||
|
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASS}
|
||||||
|
MYSQL_DATABASE: ${DB_NAME}
|
||||||
|
MYSQL_USER: ${DB_USER}
|
||||||
|
MYSQL_PASSWORD: ${DB_PASS}
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
# .env Datei
|
||||||
|
WEB_PORT=8000
|
||||||
|
DB_NAME=appdb
|
||||||
|
DB_USER=appuser
|
||||||
|
DB_PASS=secret
|
||||||
|
DB_ROOT_PASS=rootsecret
|
||||||
|
```
|
||||||
|
|
||||||
|
## Übung 6: Service-Abhängigkeiten
|
||||||
|
**Aufgabe:** Konfiguriere ein Compose-Setup mit drei Services (Backend mit PHP-FPM und Nginx, Frontend, DB), wobei Backend von DB abhängt und Frontend von Backend.
|
||||||
|
|
||||||
|
**Lösung:**
|
||||||
|
```yaml
|
||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
frontend:
|
||||||
|
image: node:16
|
||||||
|
command: npm start
|
||||||
|
ports:
|
||||||
|
- "3000:3000"
|
||||||
|
depends_on:
|
||||||
|
- nginx
|
||||||
|
|
||||||
|
nginx:
|
||||||
|
image: nginx
|
||||||
|
ports:
|
||||||
|
- "8000:80"
|
||||||
|
volumes:
|
||||||
|
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
|
||||||
|
depends_on:
|
||||||
|
- php
|
||||||
|
|
||||||
|
php:
|
||||||
|
image: php:8.1-fpm
|
||||||
|
volumes:
|
||||||
|
- ./src:/var/www/html
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
|
||||||
|
db:
|
||||||
|
image: mysql:8.0
|
||||||
|
environment:
|
||||||
|
MYSQL_ROOT_PASSWORD: root
|
||||||
|
MYSQL_DATABASE: app
|
||||||
|
```
|
||||||
|
|
||||||
|
## Übung 7: Build-Konfiguration
|
||||||
|
**Aufgabe:** Erstelle ein Compose-File mit einem Service, der aus einem lokalen Dockerfile gebaut wird.
|
||||||
|
|
||||||
|
**Lösung:**
|
||||||
|
```yaml
|
||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
nginx:
|
||||||
|
image: nginx
|
||||||
|
ports:
|
||||||
|
- "8000:80"
|
||||||
|
volumes:
|
||||||
|
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
|
||||||
|
depends_on:
|
||||||
|
- php
|
||||||
|
|
||||||
|
php:
|
||||||
|
build:
|
||||||
|
context: ./php
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
args:
|
||||||
|
- PHP_VERSION=8.1
|
||||||
|
volumes:
|
||||||
|
- ./src:/var/www/html
|
||||||
|
```
|
||||||
|
|
||||||
|
```dockerfile
|
||||||
|
# ./php/Dockerfile
|
||||||
|
ARG PHP_VERSION=8.1
|
||||||
|
FROM php:${PHP_VERSION}-fpm
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
libzip-dev \
|
||||||
|
zip \
|
||||||
|
&& docker-php-ext-install zip pdo_mysql
|
||||||
|
|
||||||
|
WORKDIR /var/www/html
|
||||||
|
```
|
||||||
|
|
||||||
|
## Übung 8: Service-Skalierung
|
||||||
|
**Aufgabe:** Konfiguriere ein Compose-Setup, bei dem der Nginx-Service auf 3 Instanzen skaliert werden kann.
|
||||||
|
|
||||||
|
**Lösung:**
|
||||||
|
```yaml
|
||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
nginx:
|
||||||
|
image: nginx
|
||||||
|
ports:
|
||||||
|
- "8080-8082:80"
|
||||||
|
deploy:
|
||||||
|
replicas: 3
|
||||||
|
volumes:
|
||||||
|
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
|
||||||
|
depends_on:
|
||||||
|
- php
|
||||||
|
|
||||||
|
php:
|
||||||
|
image: php:8.1-fpm
|
||||||
|
volumes:
|
||||||
|
- ./src:/var/www/html
|
||||||
|
|
||||||
|
db:
|
||||||
|
image: mysql:8.0
|
||||||
|
environment:
|
||||||
|
MYSQL_ROOT_PASSWORD: root
|
||||||
|
```
|
||||||
|
|
||||||
|
## Übung 9: Override-Konfiguration
|
||||||
|
**Aufgabe:** Erstelle eine Basis-Compose-Datei und eine Entwicklungs-Override-Datei.
|
||||||
|
|
||||||
|
**Lösung:**
|
||||||
|
```yaml
|
||||||
|
# docker-compose.yml
|
||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
nginx:
|
||||||
|
image: nginx
|
||||||
|
ports:
|
||||||
|
- "80:80"
|
||||||
|
depends_on:
|
||||||
|
- php
|
||||||
|
|
||||||
|
php:
|
||||||
|
image: php:8.1-fpm
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# docker-compose.override.yml
|
||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
nginx:
|
||||||
|
ports:
|
||||||
|
- "8080:80"
|
||||||
|
volumes:
|
||||||
|
- ./src:/var/www/html
|
||||||
|
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
|
||||||
|
environment:
|
||||||
|
- DEBUG=true
|
||||||
|
|
||||||
|
php:
|
||||||
|
volumes:
|
||||||
|
- ./src:/var/www/html
|
||||||
|
environment:
|
||||||
|
- DEBUG=true
|
||||||
|
```
|
||||||
|
|
||||||
|
## Übung 10: Debugging-Setup
|
||||||
|
**Aufgabe:** Erstelle ein Compose-Setup für PHP-FPM mit Nginx und Xdebug-Unterstützung.
|
||||||
|
|
||||||
|
**Lösung:**
|
||||||
|
```yaml
|
||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
nginx:
|
||||||
|
image: nginx
|
||||||
|
ports:
|
||||||
|
- "8000:80"
|
||||||
|
volumes:
|
||||||
|
- ./src:/var/www/html
|
||||||
|
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
|
||||||
|
depends_on:
|
||||||
|
- php
|
||||||
|
|
||||||
|
php:
|
||||||
|
build:
|
||||||
|
context: ./php
|
||||||
|
dockerfile: Dockerfile.dev
|
||||||
|
volumes:
|
||||||
|
- ./src:/var/www/html
|
||||||
|
environment:
|
||||||
|
XDEBUG_CONFIG: client_host=host.docker.internal
|
||||||
|
PHP_IDE_CONFIG: serverName=docker
|
||||||
|
extra_hosts:
|
||||||
|
- "host.docker.internal:host-gateway"
|
||||||
|
```
|
||||||
|
|
||||||
|
```dockerfile
|
||||||
|
# ./php/Dockerfile.dev
|
||||||
|
FROM php:8.1-fpm
|
||||||
|
|
||||||
|
RUN pecl install xdebug \
|
||||||
|
&& docker-php-ext-enable xdebug
|
||||||
|
|
||||||
|
COPY xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
|
||||||
|
```
|
||||||
|
|
||||||
|
```ini
|
||||||
|
# ./php/xdebug.ini
|
||||||
|
zend_extension=xdebug
|
||||||
|
xdebug.mode=develop,debug
|
||||||
|
xdebug.start_with_request=yes
|
||||||
|
xdebug.client_port=9003
|
||||||
|
```
|
||||||
77
README.md
Normal file
77
README.md
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
# Docker-Workshop Konzept
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## Teil 1: Docker Basics
|
||||||
|
|
||||||
|
### Vortrag
|
||||||
|
- **Einführung**
|
||||||
|
- Container vs. VM
|
||||||
|
- Docker-Architektur (Client, Daemon, Registry)
|
||||||
|
- Images und Container
|
||||||
|
|
||||||
|
- **Docker-Images**
|
||||||
|
- Image-Aufbau und Schichten
|
||||||
|
- Dockerfile-Syntax
|
||||||
|
- Build-Prozess
|
||||||
|
- Image-Registry (Docker Hub)
|
||||||
|
|
||||||
|
- **Container-Lebenszyklus**
|
||||||
|
- Starten, Stoppen, Löschen
|
||||||
|
- Container-Isolation
|
||||||
|
- Ports und Netzwerke
|
||||||
|
- Volumes für Datenpersistenz
|
||||||
|
|
||||||
|
[Komplettes Vortragsscript zu Docker Basics](01%20docker-basics.md)
|
||||||
|
|
||||||
|
### Praktische Übungen
|
||||||
|
- Ersten Container starten
|
||||||
|
- Container-Inspektion
|
||||||
|
- Einfaches Dockerfile erstellen
|
||||||
|
- Image bauen und taggen
|
||||||
|
- Container mit Volumes
|
||||||
|
- Bind Mount für Entwicklung
|
||||||
|
- Container-Netzwerk erstellen
|
||||||
|
- Multi-Stage Build
|
||||||
|
- Image in Registry pushen
|
||||||
|
- Container-Ressourcen begrenzen
|
||||||
|
|
||||||
|
[Übungsaufgaben](02%20docker-basics-uebungen.md) | [Übungsaufgaben mit Lösungen](03%20docker-basics-uebungen-mit-loesung.md)
|
||||||
|
|
||||||
|
## Teil 2: Docker Compose
|
||||||
|
|
||||||
|
### Vortrag
|
||||||
|
- **Einführung Docker Compose**
|
||||||
|
- Zweck und Vorteile
|
||||||
|
- YAML-Syntax
|
||||||
|
- Grundbefehle
|
||||||
|
|
||||||
|
- **Mehrcontainer-Anwendungen**
|
||||||
|
- Service-Abhängigkeiten
|
||||||
|
- Umgebungsvariablen
|
||||||
|
- Netzwerke zwischen Containern
|
||||||
|
|
||||||
|
- **Docker Compose in Entwicklung**
|
||||||
|
- Hot-Reloading
|
||||||
|
- Debugging
|
||||||
|
- Ressourcenkontrolle
|
||||||
|
|
||||||
|
- **Zusammenfassung und Beispiel**
|
||||||
|
- LAMP-Stack Beispiel
|
||||||
|
- Praktische Befehle
|
||||||
|
|
||||||
|
[Komplettes Vortragsscript zu Docker Compose](04%20docker-compose-basics.md)
|
||||||
|
|
||||||
|
### Praktische Übungen
|
||||||
|
- Einfaches Compose-File erstellen
|
||||||
|
- Multi-Service Anwendung
|
||||||
|
- Volume-Konfiguration
|
||||||
|
- Netzwerk-Konfiguration
|
||||||
|
- Umgebungsvariablen
|
||||||
|
- Service-Abhängigkeiten
|
||||||
|
- Build-Konfiguration
|
||||||
|
- Service-Skalierung
|
||||||
|
- Override-Konfiguration
|
||||||
|
- Debugging-Setup
|
||||||
|
|
||||||
|
[Übungsaufgaben](05%20docker-compose-uebungen.md) | [Übungsaufgaben mit Lösungen](06%20docker-compose-uebungen-mit-loesung.md)
|
||||||
146
docker-konzepte.svg
Normal file
146
docker-konzepte.svg
Normal file
@@ -0,0 +1,146 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500">
|
||||||
|
<rect width="837.871" height="682.975" fill="#f5f5f5" x="-112.13" y="-81.335" style=""/>
|
||||||
|
<rect x="-93.032" y="-61.869" width="800" height="647.262" rx="10" ry="10" fill="#e9f0f5" stroke="#2496ed" stroke-width="2" style=""/>
|
||||||
|
<text x="-73.032" y="-31.869" font-family="Arial" font-size="18" font-weight="bold" fill="#333" style="white-space: pre; font-size: 18px;">Docker Host</text>
|
||||||
|
<rect x="-72.74" y="-11.954" width="760" height="490" rx="8" ry="8" fill="#f0f7fa" stroke="#2496ed" stroke-width="2" stroke-dasharray="5,5"/>
|
||||||
|
<text x="-53.032" y="18.131" font-family="Arial" font-size="16" font-weight="bold" fill="#333" style="white-space: pre; font-size: 16px;">Docker Engine</text>
|
||||||
|
<rect x="206.968" y="28.131" width="160" height="110" rx="5" ry="5" fill="#2496ed" stroke="#1e88e5" stroke-width="2"/>
|
||||||
|
<text x="286.968" y="53.131" font-family="Arial" font-size="14" font-weight="bold" fill="white" text-anchor="middle" style="white-space: pre; font-size: 14px;">Docker Daemon</text>
|
||||||
|
<rect x="221.968" y="63.131" width="130" height="25" rx="3" ry="3" fill="#1a75bb" stroke="#1e88e5" stroke-width="1"/>
|
||||||
|
<text x="286.968" y="80.131" font-family="Arial" font-size="11" fill="white" text-anchor="middle" style="white-space: pre; font-size: 11px;">containerd</text>
|
||||||
|
<rect x="221.968" y="93.131" width="130" height="25" rx="3" ry="3" fill="#1a75bb" stroke="#1e88e5" stroke-width="1"/>
|
||||||
|
<text x="286.968" y="110.131" font-family="Arial" font-size="11" fill="white" text-anchor="middle" style="white-space: pre; font-size: 11px;">runc</text>
|
||||||
|
<rect x="-53.032" y="28.131" width="160" height="110" rx="5" ry="5" fill="#2496ed" stroke="#1e88e5" stroke-width="2"/>
|
||||||
|
<text x="26.968" y="53.131" font-family="Arial" font-size="14" font-weight="bold" fill="white" text-anchor="middle" style="white-space: pre; font-size: 14px;">Docker Client</text>
|
||||||
|
<rect x="-38.032" y="63.131" width="130" height="25" rx="3" ry="3" fill="#1a75bb" stroke="#1e88e5" stroke-width="1"/>
|
||||||
|
<text x="26.968" y="80.131" font-family="Arial" font-size="11" fill="white" text-anchor="middle" style="white-space: pre; font-size: 11px;">CLI (docker)</text>
|
||||||
|
<rect x="-38.032" y="93.131" width="130" height="25" rx="3" ry="3" fill="#1a75bb" stroke="#1e88e5" stroke-width="1"/>
|
||||||
|
<text x="26.968" y="110.131" font-family="Arial" font-size="11" fill="white" text-anchor="middle" style="white-space: pre; font-size: 11px;">docker-compose</text>
|
||||||
|
<rect x="476.968" y="28.131" width="160" height="110" rx="5" ry="5" fill="#2496ed" stroke="#1e88e5" stroke-width="2"/>
|
||||||
|
<text x="556.968" y="53.131" font-family="Arial" font-size="14" font-weight="bold" fill="white" text-anchor="middle" style="white-space: pre; font-size: 14px;">Docker Registry</text>
|
||||||
|
<rect x="491.968" y="63.131" width="130" height="25" rx="3" ry="3" fill="#1a75bb" stroke="#1e88e5" stroke-width="1"/>
|
||||||
|
<text x="556.968" y="80.131" font-family="Arial" font-size="11" fill="white" text-anchor="middle" style="white-space: pre; font-size: 11px;">Docker Hub</text>
|
||||||
|
<rect x="491.968" y="93.131" width="130" height="25" rx="3" ry="3" fill="#1a75bb" stroke="#1e88e5" stroke-width="1"/>
|
||||||
|
<text x="556.968" y="110.131" font-family="Arial" font-size="11" fill="white" text-anchor="middle" style="white-space: pre; font-size: 11px;">Private Registry</text>
|
||||||
|
<rect x="6.968" y="183.131" width="160" height="110" rx="5" ry="5" fill="#3fe0d0" stroke="#1e88e5" stroke-width="2"/>
|
||||||
|
<text x="86.968" y="203.131" font-family="Arial" font-size="14" font-weight="bold" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 14px;">Images</text>
|
||||||
|
<rect x="21.968" y="213.131" width="130" height="20" rx="3" ry="3" fill="#2ed1c3" stroke="#1e88e5" stroke-width="1"/>
|
||||||
|
<text x="86.968" y="227.131" font-family="Arial" font-size="10" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 10px;">Basis-Layer (OS)</text>
|
||||||
|
<rect x="21.968" y="233.131" width="130" height="20" rx="3" ry="3" fill="#2ed1c3" stroke="#1e88e5" stroke-width="1"/>
|
||||||
|
<text x="86.968" y="247.131" font-family="Arial" font-size="10" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 10px;">Anwendungs-Layer</text>
|
||||||
|
<rect x="21.968" y="253.131" width="130" height="20" rx="3" ry="3" fill="#2ed1c3" stroke="#1e88e5" stroke-width="1"/>
|
||||||
|
<text x="86.968" y="267.131" font-family="Arial" font-size="10" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 10px;">Konfiguration</text>
|
||||||
|
<rect x="236.968" y="183.131" width="160" height="110" rx="5" ry="5" fill="#3fe0d0" stroke="#1e88e5" stroke-width="2"/>
|
||||||
|
<text x="316.968" y="203.131" font-family="Arial" font-size="14" font-weight="bold" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 14px;">Container</text>
|
||||||
|
<rect x="251.968" y="213.131" width="130" height="20" rx="3" ry="3" fill="#2ed1c3" stroke="#1e88e5" stroke-width="1"/>
|
||||||
|
<text x="316.968" y="227.131" font-family="Arial" font-size="10" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 10px;">Created → Running</text>
|
||||||
|
<rect x="251.968" y="233.131" width="130" height="20" rx="3" ry="3" fill="#2ed1c3" stroke="#1e88e5" stroke-width="1"/>
|
||||||
|
<text x="316.968" y="247.131" font-family="Arial" font-size="10" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 10px;">Paused / Stopped</text>
|
||||||
|
<rect x="251.968" y="253.131" width="130" height="20" rx="3" ry="3" fill="#2ed1c3" stroke="#1e88e5" stroke-width="1"/>
|
||||||
|
<text x="316.968" y="267.131" font-family="Arial" font-size="10" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 10px;">Exited → Removed</text>
|
||||||
|
<rect x="466.968" y="183.131" width="160" height="110" rx="5" ry="5" fill="#3fe0d0" stroke="#1e88e5" stroke-width="2"/>
|
||||||
|
<text x="546.968" y="203.131" font-family="Arial" font-size="14" font-weight="bold" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 14px;">Docker Compose</text>
|
||||||
|
<rect x="481.968" y="213.131" width="130" height="20" rx="3" ry="3" fill="#2ed1c3" stroke="#1e88e5" stroke-width="1"/>
|
||||||
|
<text x="546.968" y="227.131" font-family="Arial" font-size="10" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 10px;">Multi-Services</text>
|
||||||
|
<rect x="481.968" y="233.131" width="130" height="20" rx="3" ry="3" fill="#2ed1c3" stroke="#1e88e5" stroke-width="1"/>
|
||||||
|
<text x="546.968" y="247.131" font-family="Arial" font-size="10" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 10px;">Abhängigkeiten</text>
|
||||||
|
<rect x="481.968" y="253.131" width="130" height="20" rx="3" ry="3" fill="#2ed1c3" stroke="#1e88e5" stroke-width="1"/>
|
||||||
|
<text x="546.968" y="267.131" font-family="Arial" font-size="10" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 10px;">YAML-Konfiguration</text>
|
||||||
|
<rect x="6.968" y="338.131" width="160" height="110" rx="5" ry="5" fill="#ffcc80" stroke="#ff9800" stroke-width="2"/>
|
||||||
|
<text x="86.968" y="358.131" font-family="Arial" font-size="14" font-weight="bold" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 14px;">Volumes</text>
|
||||||
|
<rect x="21.968" y="368.131" width="130" height="20" rx="3" ry="3" fill="#ffb74d" stroke="#ff9800" stroke-width="1"/>
|
||||||
|
<text x="86.968" y="382.131" font-family="Arial" font-size="10" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 10px;">Named Volumes</text>
|
||||||
|
<rect x="21.968" y="388.131" width="130" height="20" rx="3" ry="3" fill="#ffb74d" stroke="#ff9800" stroke-width="1"/>
|
||||||
|
<text x="86.968" y="402.131" font-family="Arial" font-size="10" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 10px;">Bind Mounts</text>
|
||||||
|
<rect x="21.968" y="408.131" width="130" height="20" rx="3" ry="3" fill="#ffb74d" stroke="#ff9800" stroke-width="1"/>
|
||||||
|
<text x="86.968" y="422.131" font-family="Arial" font-size="10" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 10px;">tmpfs Mounts</text>
|
||||||
|
<rect x="236.968" y="338.131" width="160" height="110" rx="5" ry="5" fill="#ffcc80" stroke="#ff9800" stroke-width="2"/>
|
||||||
|
<text x="316.968" y="358.131" font-family="Arial" font-size="14" font-weight="bold" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 14px;">Networks</text>
|
||||||
|
<rect x="251.968" y="368.131" width="130" height="20" rx="3" ry="3" fill="#ffb74d" stroke="#ff9800" stroke-width="1"/>
|
||||||
|
<text x="316.968" y="382.131" font-family="Arial" font-size="10" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 10px;">Bridge Network</text>
|
||||||
|
<rect x="251.968" y="388.131" width="130" height="20" rx="3" ry="3" fill="#ffb74d" stroke="#ff9800" stroke-width="1"/>
|
||||||
|
<text x="316.968" y="402.131" font-family="Arial" font-size="10" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 10px;">Host Network</text>
|
||||||
|
<rect x="251.968" y="408.131" width="130" height="20" rx="3" ry="3" fill="#ffb74d" stroke="#ff9800" stroke-width="1"/>
|
||||||
|
<text x="316.968" y="422.131" font-family="Arial" font-size="10" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 10px;">Overlay Network</text>
|
||||||
|
<rect x="466.968" y="338.131" width="160" height="110" rx="5" ry="5" fill="#ffcc80" stroke="#ff9800" stroke-width="2"/>
|
||||||
|
<text x="546.968" y="358.131" font-family="Arial" font-size="14" font-weight="bold" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 14px;">Sicherheit</text>
|
||||||
|
<rect x="481.968" y="368.131" width="130" height="20" rx="3" ry="3" fill="#ffb74d" stroke="#ff9800" stroke-width="1"/>
|
||||||
|
<text x="546.968" y="382.131" font-family="Arial" font-size="10" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 10px;">Namespaces</text>
|
||||||
|
<rect x="481.968" y="388.131" width="130" height="20" rx="3" ry="3" fill="#ffb74d" stroke="#ff9800" stroke-width="1"/>
|
||||||
|
<text x="546.968" y="402.131" font-family="Arial" font-size="10" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 10px;">Cgroups</text>
|
||||||
|
<rect x="481.968" y="408.131" width="130" height="20" rx="3" ry="3" fill="#ffb74d" stroke="#ff9800" stroke-width="1"/>
|
||||||
|
<text x="546.968" y="422.131" font-family="Arial" font-size="10" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 10px;">Capabilities</text>
|
||||||
|
<rect x="6.968" y="148.131" width="160" height="30" rx="5" ry="5" fill="#fff" stroke="#555" stroke-width="2"/>
|
||||||
|
<text x="86.968" y="168.131" font-family="Arial" font-size="14" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 14px;">Dockerfile</text>
|
||||||
|
<rect x="466.968" y="148.131" width="160" height="30" rx="5" ry="5" fill="#fff" stroke="#555" stroke-width="2"/>
|
||||||
|
<text x="546.968" y="168.131" font-family="Arial" font-size="14" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 14px;">docker-compose.yml</text>
|
||||||
|
<path d="M 106.968 78.131 L 205.452 78.131" stroke="#555" stroke-width="2" fill="none" style=""/>
|
||||||
|
<polygon points="201.968 73.131 206.968 78.131 201.968 83.131" fill="#555"/>
|
||||||
|
<text x="156.968" y="70.131" font-family="Arial" font-size="10" fill="#555" text-anchor="middle" style="white-space: pre; font-size: 10px;">REST API</text>
|
||||||
|
<path d="M 368.052 77.614 L 474.428 77.614" stroke="#555" stroke-width="2" fill="none" style=""/>
|
||||||
|
<polygon points="471.968 73.131 476.968 78.131 471.968 83.131" fill="#555"/>
|
||||||
|
<text x="421.968" y="70.131" font-family="Arial" font-size="10" fill="#555" text-anchor="middle" style="white-space: pre; font-size: 10px;">pull/push</text>
|
||||||
|
<path d="M 286.968 138.131 L 167.087 184.449" stroke="#555" stroke-width="2" fill="none" style=""/>
|
||||||
|
<polygon points="91.968 178.131 86.968 183.131 81.968 178.131" fill="#555"/>
|
||||||
|
<text x="278.033" y="161.649" font-family="Arial" font-size="10" fill="#555" text-anchor="middle" style="white-space: pre; font-size: 10px;">verwaltet</text>
|
||||||
|
<path d="M 166.968 238.131 L 234.383 238.131" stroke="#555" stroke-width="2" fill="none" style=""/>
|
||||||
|
<polygon points="231.968 233.131 236.968 238.131 231.968 243.131" fill="#555"/>
|
||||||
|
<text x="201.968" y="228.131" font-family="Arial" font-size="10" fill="#555" text-anchor="middle" style="white-space: pre; font-size: 10px;">erzeugt</text>
|
||||||
|
<path d="M 466.968 238.131 L 400.325 238.131" stroke="#555" stroke-width="2" fill="none" style=""/>
|
||||||
|
<polygon points="401.968 233.131 396.968 238.131 401.968 243.131" fill="#555"/>
|
||||||
|
<text x="431.968" y="228.131" font-family="Arial" font-size="10" fill="#555" text-anchor="middle" style="white-space: pre; font-size: 10px;">orchestriert</text>
|
||||||
|
<path d="M 256.968 293.131 L 86.816 334.359" stroke="#555" stroke-width="2" fill="none" style=""/>
|
||||||
|
<polygon points="91.968 333.131 86.968 338.131 81.968 333.131" fill="#555"/>
|
||||||
|
<text x="148.434" y="313.331" font-family="Arial" font-size="10" fill="#555" text-anchor="middle" style="white-space: pre; font-size: 10px;">nutzt</text>
|
||||||
|
<path d="M 316.968 293.131 L 316.968 335.131" stroke="#555" stroke-width="2" fill="none" style=""/>
|
||||||
|
<polygon points="311.968 333.131 316.968 338.131 321.968 333.131" fill="#555"/>
|
||||||
|
<text x="279.216" y="320.691" font-family="Arial" font-size="10" fill="#555" text-anchor="middle" style="white-space: pre; font-size: 10px;">kommuniziert</text>
|
||||||
|
<path d="M 376.968 293.131 L 506.863 334.249" stroke="#555" stroke-width="2" fill="none" style=""/>
|
||||||
|
<polygon points="501.968 333.131 506.968 338.131 511.968 333.131" fill="#555"/>
|
||||||
|
<text x="477.634" y="316.624" font-family="Arial" font-size="10" fill="#555" text-anchor="middle" style="white-space: pre; font-size: 10px;">isoliert</text>
|
||||||
|
<polygon points="161.968 182.131 166.968 187.131 171.968 182.131" fill="#555" style="transform-box: fill-box; transform-origin: 50% 50%;" transform="matrix(0.5, 0.866025, -0.866025, 0.5, 0.000005, -0.000004)"/>
|
||||||
|
<text x="-10.935" y="173.575" font-family="Arial" font-size="10" fill="#555" text-anchor="middle" style="white-space: pre; font-size: 10px;">baut</text>
|
||||||
|
<polygon points="543.002 177.572 548.002 182.572 553.002 177.572" fill="#555"/>
|
||||||
|
<text x="433.852" y="167.048" font-family="Arial" font-size="10" fill="#555" text-anchor="middle" style="white-space: pre; font-size: 10px;">konfiguriert</text>
|
||||||
|
<g transform="matrix(1, 0, 0, 1, -53.032021, 458.13089)">
|
||||||
|
<rect width="300" height="25" rx="5" ry="5" fill="#e0e0e0" stroke="#555" stroke-width="1"/>
|
||||||
|
<text x="150" y="17" font-family="Arial" font-size="12" fill="#333" text-anchor="middle" style="white-space: pre;">Multi-Stage Build Prozess</text>
|
||||||
|
<rect x="10" y="30" width="80" height="20" rx="3" ry="3" fill="#d4d4d4" stroke="#555" stroke-width="1"/>
|
||||||
|
<text x="50" y="44" font-family="Arial" font-size="10" fill="#333" text-anchor="middle" style="white-space: pre;">Build Stage</text>
|
||||||
|
<rect x="110" y="30" width="80" height="20" rx="3" ry="3" fill="#d4d4d4" stroke="#555" stroke-width="1"/>
|
||||||
|
<text x="150" y="44" font-family="Arial" font-size="10" fill="#333" text-anchor="middle" style="white-space: pre;">Test Stage</text>
|
||||||
|
<rect x="210" y="30" width="80" height="20" rx="3" ry="3" fill="#d4d4d4" stroke="#555" stroke-width="1"/>
|
||||||
|
<text x="250" y="44" font-family="Arial" font-size="10" fill="#333" text-anchor="middle" style="white-space: pre;">Prod Stage</text>
|
||||||
|
<path d="M90 40 L110 40" stroke="#555" stroke-width="1" fill="none"/>
|
||||||
|
<polygon points="105,37 110,40 105,43" fill="#555"/>
|
||||||
|
<path d="M190 40 L210 40" stroke="#555" stroke-width="1" fill="none"/>
|
||||||
|
<polygon points="205,37 210,40 205,43" fill="#555"/>
|
||||||
|
</g>
|
||||||
|
<g transform="matrix(1, 0, 0, 1, 306.967987, 458.13089)">
|
||||||
|
<rect width="350" height="25" rx="5" ry="5" fill="#e0e0e0" stroke="#555" stroke-width="1"/>
|
||||||
|
<text x="175" y="17" font-family="Arial" font-size="12" fill="#333" text-anchor="middle" style="white-space: pre;">Container vs. VM Architektur</text>
|
||||||
|
<rect x="20" y="30" width="120" height="15" rx="2" ry="2" fill="#2496ed" stroke="#555" stroke-width="1"/>
|
||||||
|
<text x="80" y="41" font-family="Arial" font-size="9" fill="white" text-anchor="middle" style="white-space: pre;">Container</text>
|
||||||
|
<rect x="20" y="45" width="120" height="15" rx="2" ry="2" fill="#2496ed" stroke="#555" stroke-width="1"/>
|
||||||
|
<text x="80" y="56" font-family="Arial" font-size="9" fill="white" text-anchor="middle" style="white-space: pre;">Container</text>
|
||||||
|
<rect x="20" y="60" width="120" height="15" rx="2" ry="2" fill="#1a75bb" stroke="#555" stroke-width="1"/>
|
||||||
|
<text x="80" y="71" font-family="Arial" font-size="9" fill="white" text-anchor="middle" style="white-space: pre;">Docker Engine</text>
|
||||||
|
<rect x="20" y="75" width="120" height="15" rx="2" ry="2" fill="#ccc" stroke="#555" stroke-width="1"/>
|
||||||
|
<text x="80" y="86" font-family="Arial" font-size="9" fill="#333" text-anchor="middle" style="white-space: pre;">Host OS Kernel</text>
|
||||||
|
<rect x="20" y="90" width="120" height="15" rx="2" ry="2" fill="#aaa" stroke="#555" stroke-width="1"/>
|
||||||
|
<text x="80" y="101" font-family="Arial" font-size="9" fill="#333" text-anchor="middle" style="white-space: pre;">Infrastruktur</text>
|
||||||
|
<rect x="210" y="30" width="120" height="15" rx="2" ry="2" fill="#85c47c" stroke="#555" stroke-width="1"/>
|
||||||
|
<text x="270" y="41" font-family="Arial" font-size="9" fill="#333" text-anchor="middle" style="white-space: pre;">App</text>
|
||||||
|
<rect x="210" y="45" width="120" height="15" rx="2" ry="2" fill="#85c47c" stroke="#555" stroke-width="1"/>
|
||||||
|
<text x="270" y="56" font-family="Arial" font-size="9" fill="#333" text-anchor="middle" style="white-space: pre;">Gast OS</text>
|
||||||
|
<rect x="210" y="60" width="120" height="15" rx="2" ry="2" fill="#76b96c" stroke="#555" stroke-width="1"/>
|
||||||
|
<text x="270" y="71" font-family="Arial" font-size="9" fill="#333" text-anchor="middle" style="white-space: pre;">Hypervisor</text>
|
||||||
|
<rect x="210" y="75" width="120" height="15" rx="2" ry="2" fill="#ccc" stroke="#555" stroke-width="1"/>
|
||||||
|
<text x="270" y="86" font-family="Arial" font-size="9" fill="#333" text-anchor="middle" style="white-space: pre;">Host OS</text>
|
||||||
|
<rect x="210" y="90" width="120" height="15" rx="2" ry="2" fill="#aaa" stroke="#555" stroke-width="1"/>
|
||||||
|
<text x="270" y="101" font-family="Arial" font-size="9" fill="#333" text-anchor="middle" style="white-space: pre;">Infrastruktur</text>
|
||||||
|
<text x="80" y="115" font-family="Arial" font-size="10" font-weight="bold" fill="#333" text-anchor="middle" style="white-space: pre;">Docker Container</text>
|
||||||
|
<text x="270" y="115" font-family="Arial" font-size="10" font-weight="bold" fill="#333" text-anchor="middle" style="white-space: pre;">Virtuelle Maschine</text>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 18 KiB |
Reference in New Issue
Block a user