Initial Commit

This commit is contained in:
Frank Woeckener
2025-03-17 13:04:59 +01:00
commit e429c37f62
9 changed files with 1086 additions and 0 deletions

118
01 docker-basics.md Normal file
View File

@@ -0,0 +1,118 @@
# 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
```
## Schaubild File-Layerstruktur in Containern
![Container Layers](docker-layers.svg)
## 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
```

View 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.

View 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
View 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
```

View 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.

View 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
View File

@@ -0,0 +1,77 @@
# Docker-Workshop Konzept
![Docker Konzepte](docker-konzepte.svg)
## 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
View File

@@ -0,0 +1,146 @@
<?xml version="1.0" encoding="utf-8"?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 837 683">
<rect width="837.871" height="682.975" fill="#f5f5f5" x="-0.383" y="-0.271" style=""/>
<rect x="18.715" y="19.195" width="800" height="647.262" rx="10" ry="10" fill="#e9f0f5" stroke="#2496ed" stroke-width="2" style=""/>
<text x="38.715" y="49.195" font-family="Arial" font-size="18" font-weight="bold" fill="#333" style="white-space: pre; font-size: 18px;">Docker Host</text>
<rect x="39.007" y="69.11" width="760" height="490" rx="8" ry="8" fill="#f0f7fa" stroke="#2496ed" stroke-width="2" stroke-dasharray="5,5"/>
<text x="58.715" y="99.195" font-family="Arial" font-size="16" font-weight="bold" fill="#333" style="white-space: pre; font-size: 16px;">Docker Engine</text>
<rect x="318.715" y="109.195" width="160" height="110" rx="5" ry="5" fill="#2496ed" stroke="#1e88e5" stroke-width="2"/>
<text x="398.715" y="134.195" 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="333.715" y="144.195" width="130" height="25" rx="3" ry="3" fill="#1a75bb" stroke="#1e88e5" stroke-width="1"/>
<text x="398.715" y="161.195" font-family="Arial" font-size="11" fill="white" text-anchor="middle" style="white-space: pre; font-size: 11px;">containerd</text>
<rect x="333.715" y="174.195" width="130" height="25" rx="3" ry="3" fill="#1a75bb" stroke="#1e88e5" stroke-width="1"/>
<text x="398.715" y="191.195" font-family="Arial" font-size="11" fill="white" text-anchor="middle" style="white-space: pre; font-size: 11px;">runc</text>
<rect x="58.715" y="109.195" width="160" height="110" rx="5" ry="5" fill="#2496ed" stroke="#1e88e5" stroke-width="2"/>
<text x="138.715" y="134.195" 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="73.715" y="144.195" width="130" height="25" rx="3" ry="3" fill="#1a75bb" stroke="#1e88e5" stroke-width="1"/>
<text x="138.715" y="161.195" font-family="Arial" font-size="11" fill="white" text-anchor="middle" style="white-space: pre; font-size: 11px;">CLI (docker)</text>
<rect x="73.715" y="174.195" width="130" height="25" rx="3" ry="3" fill="#1a75bb" stroke="#1e88e5" stroke-width="1"/>
<text x="138.715" y="191.195" font-family="Arial" font-size="11" fill="white" text-anchor="middle" style="white-space: pre; font-size: 11px;">docker-compose</text>
<rect x="588.715" y="109.195" width="160" height="110" rx="5" ry="5" fill="#2496ed" stroke="#1e88e5" stroke-width="2"/>
<text x="668.715" y="134.195" 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="603.715" y="144.195" width="130" height="25" rx="3" ry="3" fill="#1a75bb" stroke="#1e88e5" stroke-width="1"/>
<text x="668.715" y="161.195" font-family="Arial" font-size="11" fill="white" text-anchor="middle" style="white-space: pre; font-size: 11px;">Docker Hub</text>
<rect x="603.715" y="174.195" width="130" height="25" rx="3" ry="3" fill="#1a75bb" stroke="#1e88e5" stroke-width="1"/>
<text x="668.715" y="191.195" font-family="Arial" font-size="11" fill="white" text-anchor="middle" style="white-space: pre; font-size: 11px;">Private Registry</text>
<rect x="118.715" y="264.195" width="160" height="110" rx="5" ry="5" fill="#3fe0d0" stroke="#1e88e5" stroke-width="2"/>
<text x="198.715" y="284.195" 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="133.715" y="294.195" width="130" height="20" rx="3" ry="3" fill="#2ed1c3" stroke="#1e88e5" stroke-width="1"/>
<text x="198.715" y="308.195" font-family="Arial" font-size="10" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 10px;">Basis-Layer (OS)</text>
<rect x="133.715" y="314.195" width="130" height="20" rx="3" ry="3" fill="#2ed1c3" stroke="#1e88e5" stroke-width="1"/>
<text x="198.715" y="328.195" font-family="Arial" font-size="10" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 10px;">Anwendungs-Layer</text>
<rect x="133.715" y="334.195" width="130" height="20" rx="3" ry="3" fill="#2ed1c3" stroke="#1e88e5" stroke-width="1"/>
<text x="198.715" y="348.195" font-family="Arial" font-size="10" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 10px;">Konfiguration</text>
<rect x="348.715" y="264.195" width="160" height="110" rx="5" ry="5" fill="#3fe0d0" stroke="#1e88e5" stroke-width="2"/>
<text x="428.715" y="284.195" 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="363.715" y="294.195" width="130" height="20" rx="3" ry="3" fill="#2ed1c3" stroke="#1e88e5" stroke-width="1"/>
<text x="428.715" y="308.195" font-family="Arial" font-size="10" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 10px;">Created → Running</text>
<rect x="363.715" y="314.195" width="130" height="20" rx="3" ry="3" fill="#2ed1c3" stroke="#1e88e5" stroke-width="1"/>
<text x="428.715" y="328.195" font-family="Arial" font-size="10" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 10px;">Paused / Stopped</text>
<rect x="363.715" y="334.195" width="130" height="20" rx="3" ry="3" fill="#2ed1c3" stroke="#1e88e5" stroke-width="1"/>
<text x="428.715" y="348.195" font-family="Arial" font-size="10" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 10px;">Exited → Removed</text>
<rect x="578.715" y="264.195" width="160" height="110" rx="5" ry="5" fill="#3fe0d0" stroke="#1e88e5" stroke-width="2"/>
<text x="658.715" y="284.195" 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="593.715" y="294.195" width="130" height="20" rx="3" ry="3" fill="#2ed1c3" stroke="#1e88e5" stroke-width="1"/>
<text x="658.715" y="308.195" font-family="Arial" font-size="10" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 10px;">Multi-Services</text>
<rect x="593.715" y="314.195" width="130" height="20" rx="3" ry="3" fill="#2ed1c3" stroke="#1e88e5" stroke-width="1"/>
<text x="658.715" y="328.195" font-family="Arial" font-size="10" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 10px;">Abhängigkeiten</text>
<rect x="593.715" y="334.195" width="130" height="20" rx="3" ry="3" fill="#2ed1c3" stroke="#1e88e5" stroke-width="1"/>
<text x="658.715" y="348.195" font-family="Arial" font-size="10" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 10px;">YAML-Konfiguration</text>
<rect x="118.715" y="419.195" width="160" height="110" rx="5" ry="5" fill="#ffcc80" stroke="#ff9800" stroke-width="2"/>
<text x="198.715" y="439.195" 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="133.715" y="449.195" width="130" height="20" rx="3" ry="3" fill="#ffb74d" stroke="#ff9800" stroke-width="1"/>
<text x="198.715" y="463.195" font-family="Arial" font-size="10" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 10px;">Named Volumes</text>
<rect x="133.715" y="469.195" width="130" height="20" rx="3" ry="3" fill="#ffb74d" stroke="#ff9800" stroke-width="1"/>
<text x="198.715" y="483.195" font-family="Arial" font-size="10" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 10px;">Bind Mounts</text>
<rect x="133.715" y="489.195" width="130" height="20" rx="3" ry="3" fill="#ffb74d" stroke="#ff9800" stroke-width="1"/>
<text x="198.715" y="503.195" font-family="Arial" font-size="10" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 10px;">tmpfs Mounts</text>
<rect x="348.715" y="419.195" width="160" height="110" rx="5" ry="5" fill="#ffcc80" stroke="#ff9800" stroke-width="2"/>
<text x="428.715" y="439.195" 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="363.715" y="449.195" width="130" height="20" rx="3" ry="3" fill="#ffb74d" stroke="#ff9800" stroke-width="1"/>
<text x="428.715" y="463.195" font-family="Arial" font-size="10" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 10px;">Bridge Network</text>
<rect x="363.715" y="469.195" width="130" height="20" rx="3" ry="3" fill="#ffb74d" stroke="#ff9800" stroke-width="1"/>
<text x="428.715" y="483.195" font-family="Arial" font-size="10" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 10px;">Host Network</text>
<rect x="363.715" y="489.195" width="130" height="20" rx="3" ry="3" fill="#ffb74d" stroke="#ff9800" stroke-width="1"/>
<text x="428.715" y="503.195" font-family="Arial" font-size="10" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 10px;">Overlay Network</text>
<rect x="578.715" y="419.195" width="160" height="110" rx="5" ry="5" fill="#ffcc80" stroke="#ff9800" stroke-width="2"/>
<text x="658.715" y="439.195" 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="593.715" y="449.195" width="130" height="20" rx="3" ry="3" fill="#ffb74d" stroke="#ff9800" stroke-width="1"/>
<text x="658.715" y="463.195" font-family="Arial" font-size="10" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 10px;">Namespaces</text>
<rect x="593.715" y="469.195" width="130" height="20" rx="3" ry="3" fill="#ffb74d" stroke="#ff9800" stroke-width="1"/>
<text x="658.715" y="483.195" font-family="Arial" font-size="10" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 10px;">Cgroups</text>
<rect x="593.715" y="489.195" width="130" height="20" rx="3" ry="3" fill="#ffb74d" stroke="#ff9800" stroke-width="1"/>
<text x="658.715" y="503.195" font-family="Arial" font-size="10" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 10px;">Capabilities</text>
<rect x="118.715" y="229.195" width="160" height="30" rx="5" ry="5" fill="#fff" stroke="#555" stroke-width="2"/>
<text x="198.715" y="249.195" font-family="Arial" font-size="14" fill="#333" text-anchor="middle" style="white-space: pre; font-size: 14px;">Dockerfile</text>
<rect x="578.715" y="229.195" width="160" height="30" rx="5" ry="5" fill="#fff" stroke="#555" stroke-width="2"/>
<text x="658.715" y="249.195" 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 218.715 159.195 L 317.199 159.195" stroke="#555" stroke-width="2" fill="none" style=""/>
<polygon points="313.715 154.195 318.715 159.195 313.715 164.195" fill="#555"/>
<text x="268.715" y="151.195" font-family="Arial" font-size="10" fill="#555" text-anchor="middle" style="white-space: pre; font-size: 10px;">REST API</text>
<path d="M 479.799 158.678 L 586.175 158.678" stroke="#555" stroke-width="2" fill="none" style=""/>
<polygon points="583.715 154.195 588.715 159.195 583.715 164.195" fill="#555"/>
<text x="533.715" y="151.195" font-family="Arial" font-size="10" fill="#555" text-anchor="middle" style="white-space: pre; font-size: 10px;">pull/push</text>
<path d="M 398.715 219.195 L 278.834 265.513" stroke="#555" stroke-width="2" fill="none" style=""/>
<polygon points="203.715 259.195 198.715 264.195 193.715 259.195" fill="#555"/>
<text x="389.78" y="242.713" font-family="Arial" font-size="10" fill="#555" text-anchor="middle" style="white-space: pre; font-size: 10px;">verwaltet</text>
<path d="M 278.715 319.195 L 346.13 319.195" stroke="#555" stroke-width="2" fill="none" style=""/>
<polygon points="343.715 314.195 348.715 319.195 343.715 324.195" fill="#555"/>
<text x="313.715" y="309.195" font-family="Arial" font-size="10" fill="#555" text-anchor="middle" style="white-space: pre; font-size: 10px;">erzeugt</text>
<path d="M 578.715 319.195 L 512.072 319.195" stroke="#555" stroke-width="2" fill="none" style=""/>
<polygon points="513.715 314.195 508.715 319.195 513.715 324.195" fill="#555"/>
<text x="543.715" y="309.195" font-family="Arial" font-size="10" fill="#555" text-anchor="middle" style="white-space: pre; font-size: 10px;">orchestriert</text>
<path d="M 368.715 374.195 L 198.563 415.423" stroke="#555" stroke-width="2" fill="none" style=""/>
<polygon points="203.715 414.195 198.715 419.195 193.715 414.195" fill="#555"/>
<text x="260.181" y="394.395" font-family="Arial" font-size="10" fill="#555" text-anchor="middle" style="white-space: pre; font-size: 10px;">nutzt</text>
<path d="M 428.715 374.195 L 428.715 416.195" stroke="#555" stroke-width="2" fill="none" style=""/>
<polygon points="423.715 414.195 428.715 419.195 433.715 414.195" fill="#555"/>
<text x="390.963" y="401.755" font-family="Arial" font-size="10" fill="#555" text-anchor="middle" style="white-space: pre; font-size: 10px;">kommuniziert</text>
<path d="M 488.715 374.195 L 618.61 415.313" stroke="#555" stroke-width="2" fill="none" style=""/>
<polygon points="613.715 414.195 618.715 419.195 623.715 414.195" fill="#555"/>
<text x="589.381" y="397.688" font-family="Arial" font-size="10" fill="#555" text-anchor="middle" style="white-space: pre; font-size: 10px;">isoliert</text>
<polygon points="273.715 263.195 278.715 268.195 283.715 263.195" fill="#555" style="transform-box: fill-box; transform-origin: 50% 50%;" transform="matrix(0.5, 0.866025, -0.866025, 0.5, -0.000004, -0.00001)"/>
<text x="100.812" y="254.639" font-family="Arial" font-size="10" fill="#555" text-anchor="middle" style="white-space: pre; font-size: 10px;">baut</text>
<polygon points="654.749 258.636 659.749 263.636 664.749 258.636" fill="#555"/>
<text x="545.599" y="248.112" 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, 58.715195, 539.19519)">
<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, 418.71521, 539.19519)">
<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

26
docker-layers.svg Normal file
View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 638 390" preserveAspectRatio="xMidYMax">
<rect width="461.711" height="377.025" fill="#f8f9fa" style="" x="88.217" y="6.234"/>
<rect x="100.777" y="19.06" width="436.02" height="350.828" fill="none" stroke="#333" stroke-width="2" rx="10" style=""/>
<rect x="137.112" y="251.604" width="363.35" height="29.068" fill="#DAE8FC" stroke="#6C8EBF" stroke-width="2" style=""/>
<text x="318.787" y="269.772" font-family="Arial" font-size="16" text-anchor="middle" style="white-space: pre; font-size: 11.6px;">Base Image Layer (Basis-Betriebssystem) - Read Only</text>
<rect x="137.112" y="215.269" width="363.35" height="29.068" fill="#DAE8FC" stroke="#6C8EBF" stroke-width="2" style=""/>
<text x="318.787" y="233.437" font-family="Arial" font-size="16" text-anchor="middle" style="white-space: pre; font-size: 11.6px;">Zwischenlayer (z.B. Laufzeitumgebung) - Read Only</text>
<rect x="137.112" y="178.934" width="363.35" height="29.068" fill="#DAE8FC" stroke="#6C8EBF" stroke-width="2" style=""/>
<text x="318.787" y="197.102" font-family="Arial" font-size="16" text-anchor="middle" style="white-space: pre; font-size: 11.6px;">Anwendungslayer (App-Code) - Read Only</text>
<rect x="137.112" y="142.599" width="363.35" height="29.068" fill="#D5E8D4" stroke="#82B366" stroke-width="2" style=""/>
<text x="318.787" y="160.767" font-family="Arial" font-size="16" text-anchor="middle" style="white-space: pre; font-size: 11.6px;">Container Layer - Read Write</text>
<rect x="137.112" y="91.73" width="159.874" height="43.602" fill="#FFE6CC" stroke="#D79B00" stroke-width="2" style=""/>
<text x="217.049" y="117.165" font-family="Arial" font-size="16" text-anchor="middle" style="white-space: pre; font-size: 11.6px;">Volume Mount</text>
<rect x="340.588" y="91.73" width="159.874" height="43.602" fill="#FFE6CC" stroke="#D79B00" stroke-width="2" style=""/>
<text x="420.526" y="117.165" font-family="Arial" font-size="16" text-anchor="middle" style="white-space: pre; font-size: 11.6px;">Bind Mount</text>
<rect x="137.112" y="40.861" width="363.35" height="29.068" fill="#E1D5E7" stroke="#9673A6" stroke-width="2" style=""/>
<text x="318.787" y="59.029" font-family="Arial" font-size="16" text-anchor="middle" style="white-space: pre; font-size: 11.6px;">Union File System</text>
<line x1="318.787" y1="69.929" x2="318.787" y2="142.236" stroke="#9673A6" stroke-width="2" stroke-dasharray="5,5" style=""/>
<rect x="413.624" y="297.283" width="14.534" height="14.534" fill="#DAE8FC" stroke="#6C8EBF" stroke-width="1" style=""/>
<text x="431.792" y="308.184" font-family="Arial" font-size="14" text-anchor="start" style="white-space: pre; font-size: 10.2px;">Read-Only Layers</text>
<rect x="413.624" y="319.084" width="14.534" height="14.534" fill="#D5E8D4" stroke="#82B366" stroke-width="1" style=""/>
<text x="431.792" y="329.985" font-family="Arial" font-size="14" text-anchor="start" style="white-space: pre; font-size: 10.2px;">Read-Write Layer</text>
<rect x="413.624" y="340.885" width="14.534" height="14.534" fill="#FFE6CC" stroke="#D79B00" stroke-width="1" style=""/>
<text x="431.792" y="351.786" font-family="Arial" font-size="14" text-anchor="start" style="white-space: pre; font-size: 10.2px;">Externe Mounts</text>
</svg>

After

Width:  |  Height:  |  Size: 3.3 KiB