- 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>
23 lines
438 B
Text
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
|