container-schulung/listings/exercises/ex09-env-variables/commands.txt
Frank Engel b32d8c2472 exercises: ex16-19 hinzugefügt, commands.sh → commands.txt
- ex16: lokale Registry + VisitCounter pushen
- ex17: vollständiger Update-Zyklus (edit → build → push → restart)
- ex18: VisitCounter mit Quadlets deployen
- ex19: Container schrittweise härten (read-only, cap-drop, no-new-priv)
- alle commands.sh umbenannt in commands.txt, Shebang entfernt

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 09:09:51 +02:00

23 lines
438 B
Text

# Exercise 9 — Environment Variables
# Single variables via -e
podman run -d --name mydb \
-e POSTGRES_DB=myapp \
-e POSTGRES_USER=app \
-e POSTGRES_PASSWORD=secret \
postgres:16-alpine
# Verify
podman exec -ti mydb psql -U app myapp -c "\l"
podman rm -f mydb
# Via env-file
podman run -d --name mydb \
--env-file app.env \
postgres:16-alpine
podman exec -ti mydb psql -U app myapp -c "\l"
# Cleanup
podman rm -f mydb