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)
|
||||
251
docker-konzepte.svg
Normal file
251
docker-konzepte.svg
Normal file
@@ -0,0 +1,251 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 900 700">
|
||||
<!-- Hintergrund -->
|
||||
<rect width="900" height="700" fill="#f5f5f5"/>
|
||||
|
||||
<!-- Docker Host -->
|
||||
<rect x="50" y="80" width="800" height="560" rx="10" ry="10" fill="#e9f0f5" stroke="#2496ed" stroke-width="2"/>
|
||||
<text x="70" y="110" font-family="Arial" font-size="18" font-weight="bold" fill="#333">Docker Host</text>
|
||||
|
||||
<!-- Docker Engine -->
|
||||
<rect x="70" y="130" width="760" height="490" rx="8" ry="8" fill="#f0f7fa" stroke="#2496ed" stroke-width="2" stroke-dasharray="5,5"/>
|
||||
<text x="90" y="160" font-family="Arial" font-size="16" font-weight="bold" fill="#333">Docker Engine</text>
|
||||
|
||||
<!-- Docker Daemon Bereich -->
|
||||
<rect x="350" y="170" width="160" height="110" rx="5" ry="5" fill="#2496ed" stroke="#1e88e5" stroke-width="2"/>
|
||||
<text x="430" y="195" font-family="Arial" font-size="14" font-weight="bold" fill="white" text-anchor="middle">Docker Daemon</text>
|
||||
|
||||
<!-- Daemon-Komponenten -->
|
||||
<rect x="365" y="205" width="130" height="25" rx="3" ry="3" fill="#1a75bb" stroke="#1e88e5" stroke-width="1"/>
|
||||
<text x="430" y="222" font-family="Arial" font-size="11" fill="white" text-anchor="middle">containerd</text>
|
||||
|
||||
<rect x="365" y="235" width="130" height="25" rx="3" ry="3" fill="#1a75bb" stroke="#1e88e5" stroke-width="1"/>
|
||||
<text x="430" y="252" font-family="Arial" font-size="11" fill="white" text-anchor="middle">runc</text>
|
||||
|
||||
<!-- Docker Client Bereich -->
|
||||
<rect x="90" y="170" width="160" height="110" rx="5" ry="5" fill="#2496ed" stroke="#1e88e5" stroke-width="2"/>
|
||||
<text x="170" y="195" font-family="Arial" font-size="14" font-weight="bold" fill="white" text-anchor="middle">Docker Client</text>
|
||||
|
||||
<!-- Client-Komponenten -->
|
||||
<rect x="105" y="205" width="130" height="25" rx="3" ry="3" fill="#1a75bb" stroke="#1e88e5" stroke-width="1"/>
|
||||
<text x="170" y="222" font-family="Arial" font-size="11" fill="white" text-anchor="middle">CLI (docker)</text>
|
||||
|
||||
<rect x="105" y="235" width="130" height="25" rx="3" ry="3" fill="#1a75bb" stroke="#1e88e5" stroke-width="1"/>
|
||||
<text x="170" y="252" font-family="Arial" font-size="11" fill="white" text-anchor="middle">docker-compose</text>
|
||||
|
||||
<!-- Docker Registry -->
|
||||
<rect x="620" y="170" width="160" height="110" rx="5" ry="5" fill="#2496ed" stroke="#1e88e5" stroke-width="2"/>
|
||||
<text x="700" y="195" font-family="Arial" font-size="14" font-weight="bold" fill="white" text-anchor="middle">Docker Registry</text>
|
||||
|
||||
<!-- Registry-Komponenten -->
|
||||
<rect x="635" y="205" width="130" height="25" rx="3" ry="3" fill="#1a75bb" stroke="#1e88e5" stroke-width="1"/>
|
||||
<text x="700" y="222" font-family="Arial" font-size="11" fill="white" text-anchor="middle">Docker Hub</text>
|
||||
|
||||
<rect x="635" y="235" width="130" height="25" rx="3" ry="3" fill="#1a75bb" stroke="#1e88e5" stroke-width="1"/>
|
||||
<text x="700" y="252" font-family="Arial" font-size="11" fill="white" text-anchor="middle">Private Registry</text>
|
||||
|
||||
<!-- Images -->
|
||||
<rect x="150" y="325" width="160" height="110" rx="5" ry="5" fill="#3fe0d0" stroke="#1e88e5" stroke-width="2"/>
|
||||
<text x="230" y="345" font-family="Arial" font-size="14" font-weight="bold" fill="#333" text-anchor="middle">Images</text>
|
||||
|
||||
<!-- Image-Detailschichten -->
|
||||
<rect x="165" y="355" width="130" height="20" rx="3" ry="3" fill="#2ed1c3" stroke="#1e88e5" stroke-width="1"/>
|
||||
<text x="230" y="369" font-family="Arial" font-size="10" fill="#333" text-anchor="middle">Basis-Layer (OS)</text>
|
||||
|
||||
<rect x="165" y="375" width="130" height="20" rx="3" ry="3" fill="#2ed1c3" stroke="#1e88e5" stroke-width="1"/>
|
||||
<text x="230" y="389" font-family="Arial" font-size="10" fill="#333" text-anchor="middle">Anwendungs-Layer</text>
|
||||
|
||||
<rect x="165" y="395" width="130" height="20" rx="3" ry="3" fill="#2ed1c3" stroke="#1e88e5" stroke-width="1"/>
|
||||
<text x="230" y="409" font-family="Arial" font-size="10" fill="#333" text-anchor="middle">Konfiguration</text>
|
||||
|
||||
<!-- Container -->
|
||||
<rect x="380" y="325" width="160" height="110" rx="5" ry="5" fill="#3fe0d0" stroke="#1e88e5" stroke-width="2"/>
|
||||
<text x="460" y="345" font-family="Arial" font-size="14" font-weight="bold" fill="#333" text-anchor="middle">Container</text>
|
||||
|
||||
<!-- Container-Lebenszyklus -->
|
||||
<rect x="395" y="355" width="130" height="20" rx="3" ry="3" fill="#2ed1c3" stroke="#1e88e5" stroke-width="1"/>
|
||||
<text x="460" y="369" font-family="Arial" font-size="10" fill="#333" text-anchor="middle">Created → Running</text>
|
||||
|
||||
<rect x="395" y="375" width="130" height="20" rx="3" ry="3" fill="#2ed1c3" stroke="#1e88e5" stroke-width="1"/>
|
||||
<text x="460" y="389" font-family="Arial" font-size="10" fill="#333" text-anchor="middle">Paused / Stopped</text>
|
||||
|
||||
<rect x="395" y="395" width="130" height="20" rx="3" ry="3" fill="#2ed1c3" stroke="#1e88e5" stroke-width="1"/>
|
||||
<text x="460" y="409" font-family="Arial" font-size="10" fill="#333" text-anchor="middle">Exited → Removed</text>
|
||||
|
||||
<!-- Docker Compose -->
|
||||
<rect x="610" y="325" width="160" height="110" rx="5" ry="5" fill="#3fe0d0" stroke="#1e88e5" stroke-width="2"/>
|
||||
<text x="690" y="345" font-family="Arial" font-size="14" font-weight="bold" fill="#333" text-anchor="middle">Docker Compose</text>
|
||||
|
||||
<!-- Compose-Details -->
|
||||
<rect x="625" y="355" width="130" height="20" rx="3" ry="3" fill="#2ed1c3" stroke="#1e88e5" stroke-width="1"/>
|
||||
<text x="690" y="369" font-family="Arial" font-size="10" fill="#333" text-anchor="middle">Multi-Services</text>
|
||||
|
||||
<rect x="625" y="375" width="130" height="20" rx="3" ry="3" fill="#2ed1c3" stroke="#1e88e5" stroke-width="1"/>
|
||||
<text x="690" y="389" font-family="Arial" font-size="10" fill="#333" text-anchor="middle">Abhängigkeiten</text>
|
||||
|
||||
<rect x="625" y="395" width="130" height="20" rx="3" ry="3" fill="#2ed1c3" stroke="#1e88e5" stroke-width="1"/>
|
||||
<text x="690" y="409" font-family="Arial" font-size="10" fill="#333" text-anchor="middle">YAML-Konfiguration</text>
|
||||
|
||||
<!-- Volumes -->
|
||||
<rect x="150" y="480" width="160" height="110" rx="5" ry="5" fill="#ffcc80" stroke="#ff9800" stroke-width="2"/>
|
||||
<text x="230" y="500" font-family="Arial" font-size="14" font-weight="bold" fill="#333" text-anchor="middle">Volumes</text>
|
||||
|
||||
<!-- Volume-Typen -->
|
||||
<rect x="165" y="510" width="130" height="20" rx="3" ry="3" fill="#ffb74d" stroke="#ff9800" stroke-width="1"/>
|
||||
<text x="230" y="524" font-family="Arial" font-size="10" fill="#333" text-anchor="middle">Named Volumes</text>
|
||||
|
||||
<rect x="165" y="530" width="130" height="20" rx="3" ry="3" fill="#ffb74d" stroke="#ff9800" stroke-width="1"/>
|
||||
<text x="230" y="544" font-family="Arial" font-size="10" fill="#333" text-anchor="middle">Bind Mounts</text>
|
||||
|
||||
<rect x="165" y="550" width="130" height="20" rx="3" ry="3" fill="#ffb74d" stroke="#ff9800" stroke-width="1"/>
|
||||
<text x="230" y="564" font-family="Arial" font-size="10" fill="#333" text-anchor="middle">tmpfs Mounts</text>
|
||||
|
||||
<!-- Networks -->
|
||||
<rect x="380" y="480" width="160" height="110" rx="5" ry="5" fill="#ffcc80" stroke="#ff9800" stroke-width="2"/>
|
||||
<text x="460" y="500" font-family="Arial" font-size="14" font-weight="bold" fill="#333" text-anchor="middle">Networks</text>
|
||||
|
||||
<!-- Netzwerk-Typen -->
|
||||
<rect x="395" y="510" width="130" height="20" rx="3" ry="3" fill="#ffb74d" stroke="#ff9800" stroke-width="1"/>
|
||||
<text x="460" y="524" font-family="Arial" font-size="10" fill="#333" text-anchor="middle">Bridge Network</text>
|
||||
|
||||
<rect x="395" y="530" width="130" height="20" rx="3" ry="3" fill="#ffb74d" stroke="#ff9800" stroke-width="1"/>
|
||||
<text x="460" y="544" font-family="Arial" font-size="10" fill="#333" text-anchor="middle">Host Network</text>
|
||||
|
||||
<rect x="395" y="550" width="130" height="20" rx="3" ry="3" fill="#ffb74d" stroke="#ff9800" stroke-width="1"/>
|
||||
<text x="460" y="564" font-family="Arial" font-size="10" fill="#333" text-anchor="middle">Overlay Network</text>
|
||||
|
||||
<!-- Sicherheit -->
|
||||
<rect x="610" y="480" width="160" height="110" rx="5" ry="5" fill="#ffcc80" stroke="#ff9800" stroke-width="2"/>
|
||||
<text x="690" y="500" font-family="Arial" font-size="14" font-weight="bold" fill="#333" text-anchor="middle">Sicherheit</text>
|
||||
|
||||
<!-- Sicherheits-Komponenten -->
|
||||
<rect x="625" y="510" width="130" height="20" rx="3" ry="3" fill="#ffb74d" stroke="#ff9800" stroke-width="1"/>
|
||||
<text x="690" y="524" font-family="Arial" font-size="10" fill="#333" text-anchor="middle">Namespaces</text>
|
||||
|
||||
<rect x="625" y="530" width="130" height="20" rx="3" ry="3" fill="#ffb74d" stroke="#ff9800" stroke-width="1"/>
|
||||
<text x="690" y="544" font-family="Arial" font-size="10" fill="#333" text-anchor="middle">Cgroups</text>
|
||||
|
||||
<rect x="625" y="550" width="130" height="20" rx="3" ry="3" fill="#ffb74d" stroke="#ff9800" stroke-width="1"/>
|
||||
<text x="690" y="564" font-family="Arial" font-size="10" fill="#333" text-anchor="middle">Capabilities</text>
|
||||
|
||||
<!-- Dockerfile -->
|
||||
<rect x="150" y="290" width="160" height="30" rx="5" ry="5" fill="#fff" stroke="#555" stroke-width="2"/>
|
||||
<text x="230" y="310" font-family="Arial" font-size="14" fill="#333" text-anchor="middle">Dockerfile</text>
|
||||
|
||||
<!-- Weitere Dateien -->
|
||||
<rect x="610" y="290" width="160" height="30" rx="5" ry="5" fill="#fff" stroke="#555" stroke-width="2"/>
|
||||
<text x="690" y="310" font-family="Arial" font-size="14" fill="#333" text-anchor="middle">docker-compose.yml</text>
|
||||
|
||||
<!-- Verbindungen -->
|
||||
<!-- Client zu Daemon -->
|
||||
<path d="M250 220 L350 220" stroke="#555" stroke-width="2" fill="none"/>
|
||||
<polygon points="345,215 350,220 345,225" fill="#555"/>
|
||||
<text x="300" y="212" font-family="Arial" font-size="10" fill="#555" text-anchor="middle">REST API</text>
|
||||
|
||||
<!-- Daemon zu Registry -->
|
||||
<path d="M510 220 L620 220" stroke="#555" stroke-width="2" fill="none"/>
|
||||
<polygon points="615,215 620,220 615,225" fill="#555"/>
|
||||
<text x="565" y="212" font-family="Arial" font-size="10" fill="#555" text-anchor="middle">pull/push</text>
|
||||
|
||||
<!-- Daemon zu Images -->
|
||||
<path d="M430 280 L230 325" stroke="#555" stroke-width="2" fill="none"/>
|
||||
<polygon points="235,320 230,325 225,320" fill="#555"/>
|
||||
<text x="320" y="290" font-family="Arial" font-size="10" fill="#555" text-anchor="middle">verwaltet</text>
|
||||
|
||||
<!-- Images zu Container -->
|
||||
<path d="M310 380 L380 380" stroke="#555" stroke-width="2" fill="none"/>
|
||||
<polygon points="375,375 380,380 375,385" fill="#555"/>
|
||||
<text x="345" y="370" font-family="Arial" font-size="10" fill="#555" text-anchor="middle">erzeugt</text>
|
||||
|
||||
<!-- Compose zu Container -->
|
||||
<path d="M610 380 L540 380" stroke="#555" stroke-width="2" fill="none"/>
|
||||
<polygon points="545,375 540,380 545,385" fill="#555"/>
|
||||
<text x="575" y="370" font-family="Arial" font-size="10" fill="#555" text-anchor="middle">orchestriert</text>
|
||||
|
||||
<!-- Container zu Volumes -->
|
||||
<path d="M400 435 L230 480" stroke="#555" stroke-width="2" fill="none"/>
|
||||
<polygon points="235,475 230,480 225,475" fill="#555"/>
|
||||
<text x="300" y="460" font-family="Arial" font-size="10" fill="#555" text-anchor="middle">nutzt</text>
|
||||
|
||||
<!-- Container zu Networks -->
|
||||
<path d="M460 435 L460 480" stroke="#555" stroke-width="2" fill="none"/>
|
||||
<polygon points="455,475 460,480 465,475" fill="#555"/>
|
||||
<text x="472" y="460" font-family="Arial" font-size="10" fill="#555" text-anchor="middle">kommuniziert</text>
|
||||
|
||||
<!-- Container zu Sicherheit -->
|
||||
<path d="M520 435 L650 480" stroke="#555" stroke-width="2" fill="none"/>
|
||||
<polygon points="645,475 650,480 655,475" fill="#555"/>
|
||||
<text x="600" y="460" font-family="Arial" font-size="10" fill="#555" text-anchor="middle">isoliert</text>
|
||||
|
||||
<!-- Dockerfile zu Images -->
|
||||
<path d="M230 320 L230 325" stroke="#555" stroke-width="2" fill="none"/>
|
||||
<polygon points="225,320 230,325 235,320" fill="#555"/>
|
||||
<text x="250" y="323" font-family="Arial" font-size="10" fill="#555" text-anchor="middle">baut</text>
|
||||
|
||||
<!-- Compose-File zu Docker Compose -->
|
||||
<path d="M690 320 L690 325" stroke="#555" stroke-width="2" fill="none"/>
|
||||
<polygon points="685,320 690,325 695,320" fill="#555"/>
|
||||
<text x="710" y="323" font-family="Arial" font-size="10" fill="#555" text-anchor="middle">konfiguriert</text>
|
||||
|
||||
<!-- Multi-Stage Building -->
|
||||
<g transform="translate(90, 600)">
|
||||
<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">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">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">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">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>
|
||||
|
||||
<!-- Host vs Container Visualisierung -->
|
||||
<g transform="translate(450, 600)">
|
||||
<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">Container vs. VM Architektur</text>
|
||||
<!-- Container Stack -->
|
||||
<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">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">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">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">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">Infrastruktur</text>
|
||||
<!-- VM Stack -->
|
||||
<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">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">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">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">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">Infrastruktur</text>
|
||||
<!-- Labels -->
|
||||
<text x="80" y="115" font-family="Arial" font-size="10" font-weight="bold" fill="#333" text-anchor="middle">Docker Container</text>
|
||||
<text x="270" y="115" font-family="Arial" font-size="10" font-weight="bold" fill="#333" text-anchor="middle">Virtuelle Maschine</text>
|
||||
</g>
|
||||
|
||||
<!-- Titel -->
|
||||
<text x="450" y="50" font-family="Arial" font-size="24" font-weight="bold" fill="#333" text-anchor="middle">Docker Kernkonzepte - Detaillierte Übersicht</text>
|
||||
|
||||
<!-- Legende -->
|
||||
<rect x="780" y="640" width="15" height="10" fill="#2496ed"/>
|
||||
<text x="800" y="649" font-family="Arial" font-size="10" fill="#333" text-anchor="start">Docker Core</text>
|
||||
|
||||
<rect x="780" y="655" width="15" height="10" fill="#3fe0d0"/>
|
||||
<text x="800" y="664" font-family="Arial" font-size="10" fill="#333" text-anchor="start">Container/Images</text>
|
||||
|
||||
<rect x="780" y="670" width="15" height="10" fill="#ffcc80"/>
|
||||
<text x="800" y="679" font-family="Arial" font-size="10" fill="#333" text-anchor="start">Infrastruktur</text>
|
||||
|
||||
<rect x="780" y="685" width="15" height="10" fill="#e0e0e0"/>
|
||||
<text x="800" y="694" font-family="Arial" font-size="10" fill="#333" text-anchor="start">Konzepte</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 17 KiB |
Reference in New Issue
Block a user