diff --git a/listings/exercises/ex06-bind-mount/commands.sh b/listings/exercises/ex06-bind-mount/commands.sh index dc6f622..8bdcb1f 100755 --- a/listings/exercises/ex06-bind-mount/commands.sh +++ b/listings/exercises/ex06-bind-mount/commands.sh @@ -1,12 +1,13 @@ #!/bin/bash # Exercise 6 — Bind Mounts -# Terminal 1: write dates to /tmp/output -podman run -v /tmp:/data --rm -ti busybox \ +# Terminal 1: write dates to /tmp/output (detached) +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 -podman run -v /tmp:/data --rm busybox tail -f /data/output +# Terminal 2: watch the output (Ctrl+C to exit) +podman run --rm -v /tmp:/data busybox tail -f /data/output # Cleanup +podman stop writer && podman rm writer rm -f /tmp/output diff --git a/listings/exercises/ex07-named-volume/commands.sh b/listings/exercises/ex07-named-volume/commands.sh index 57510a4..3847552 100755 --- a/listings/exercises/ex07-named-volume/commands.sh +++ b/listings/exercises/ex07-named-volume/commands.sh @@ -3,12 +3,13 @@ podman volume create pizza -# Terminal 1: write dates into the volume -podman run -v pizza:/data --rm -ti busybox \ +# Terminal 1: write dates into the volume (detached) +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 -podman run -v pizza:/data --rm busybox tail -f /data/output +# Terminal 2: watch the output (Ctrl+C to exit) +podman run --rm -v pizza:/data busybox tail -f /data/output # Cleanup +podman stop writer && podman rm writer podman volume rm pizza