From 5ad7435542ef25b138a49ec5638b7891df370dd0 Mon Sep 17 00:00:00 2001 From: Frank Engel Date: Wed, 20 May 2026 16:03:08 +0200 Subject: [PATCH] exercises: reader --name, ex13 commands.sh Co-Authored-By: Claude Sonnet 4.6 --- listings/exercises/ex06-bind-mount/commands.sh | 6 +++--- listings/exercises/ex07-named-volume/commands.sh | 6 +++--- listings/exercises/ex13-multistage/commands.sh | 11 +++++++++++ 3 files changed, 17 insertions(+), 6 deletions(-) create mode 100755 listings/exercises/ex13-multistage/commands.sh diff --git a/listings/exercises/ex06-bind-mount/commands.sh b/listings/exercises/ex06-bind-mount/commands.sh index 8bdcb1f..39954b4 100755 --- a/listings/exercises/ex06-bind-mount/commands.sh +++ b/listings/exercises/ex06-bind-mount/commands.sh @@ -5,9 +5,9 @@ podman run -d --name writer -v /tmp:/data busybox \ sh -c 'while true; do sleep 1; date >> /data/output; done' -# Terminal 2: watch the output (Ctrl+C to exit) -podman run --rm -v /tmp:/data busybox tail -f /data/output +# Terminal 2: watch the output (Ctrl+C to exit, or: podman stop reader) +podman run --name reader -v /tmp:/data busybox tail -f /data/output # Cleanup -podman stop writer && podman rm writer +podman stop writer reader && podman rm writer reader rm -f /tmp/output diff --git a/listings/exercises/ex07-named-volume/commands.sh b/listings/exercises/ex07-named-volume/commands.sh index 3847552..c637232 100755 --- a/listings/exercises/ex07-named-volume/commands.sh +++ b/listings/exercises/ex07-named-volume/commands.sh @@ -7,9 +7,9 @@ podman volume create pizza podman run -d --name writer -v pizza:/data busybox \ sh -c 'while true; do sleep 1; date >> /data/output; done' -# Terminal 2: watch the output (Ctrl+C to exit) -podman run --rm -v pizza:/data busybox tail -f /data/output +# Terminal 2: watch the output (Ctrl+C to exit, or: podman stop reader) +podman run --name reader -v pizza:/data busybox tail -f /data/output # Cleanup -podman stop writer && podman rm writer +podman stop writer reader && podman rm writer reader podman volume rm pizza diff --git a/listings/exercises/ex13-multistage/commands.sh b/listings/exercises/ex13-multistage/commands.sh new file mode 100755 index 0000000..d72e272 --- /dev/null +++ b/listings/exercises/ex13-multistage/commands.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# Exercise 13 — Multi-stage Build + +# Build +podman build -t hello:latest . + +# Run +podman run --rm hello:latest + +# Inspect image size +podman images hello:latest