container-schulung/listings/exercises/ex05-networking/commands.sh
Frank Engel bd046e626d Tag 2 Materialien: Exercises ex05-ex15 + Ubuntu 24.04 Setup
- 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>
2026-05-19 22:04:17 +02:00

19 lines
440 B
Bash
Executable file

#!/bin/bash
# Exercise 5 — Container Networking
podman network create appnet
podman run -d --name backend --network appnet nginx:1.27
podman run -d --name frontend --network appnet -p 8080:80 nginx:1.27
podman network inspect appnet
# Container-to-container (DNS im appnet)
podman exec -ti frontend curl backend
# Host-to-container (Port-Mapping)
curl localhost:8080
# Cleanup
podman rm -f frontend backend
podman network rm appnet