- listings/exercises/ex05-ex15: alle Übungsdateien für Tag 2 (Networking, Bind Mounts, Volumes, Env Variables, Compose, Build, Push, Registry) - setup/setup-ubuntu2404.sh: Prep-Script für Ubuntu 24.04 (Noble) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
24 lines
450 B
Bash
Executable file
24 lines
450 B
Bash
Executable file
#!/bin/bash
|
|
# 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
|