exercises: reader --name, ex13 commands.sh
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
5aba4ecac2
commit
5ad7435542
3 changed files with 17 additions and 6 deletions
|
|
@ -5,9 +5,9 @@
|
||||||
podman run -d --name writer -v /tmp:/data busybox \
|
podman run -d --name writer -v /tmp:/data busybox \
|
||||||
sh -c 'while true; do sleep 1; date >> /data/output; done'
|
sh -c 'while true; do sleep 1; date >> /data/output; done'
|
||||||
|
|
||||||
# Terminal 2: watch the output (Ctrl+C to exit)
|
# Terminal 2: watch the output (Ctrl+C to exit, or: podman stop reader)
|
||||||
podman run --rm -v /tmp:/data busybox tail -f /data/output
|
podman run --name reader -v /tmp:/data busybox tail -f /data/output
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
podman stop writer && podman rm writer
|
podman stop writer reader && podman rm writer reader
|
||||||
rm -f /tmp/output
|
rm -f /tmp/output
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,9 @@ podman volume create pizza
|
||||||
podman run -d --name writer -v pizza:/data busybox \
|
podman run -d --name writer -v pizza:/data busybox \
|
||||||
sh -c 'while true; do sleep 1; date >> /data/output; done'
|
sh -c 'while true; do sleep 1; date >> /data/output; done'
|
||||||
|
|
||||||
# Terminal 2: watch the output (Ctrl+C to exit)
|
# Terminal 2: watch the output (Ctrl+C to exit, or: podman stop reader)
|
||||||
podman run --rm -v pizza:/data busybox tail -f /data/output
|
podman run --name reader -v pizza:/data busybox tail -f /data/output
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
podman stop writer && podman rm writer
|
podman stop writer reader && podman rm writer reader
|
||||||
podman volume rm pizza
|
podman volume rm pizza
|
||||||
|
|
|
||||||
11
listings/exercises/ex13-multistage/commands.sh
Executable file
11
listings/exercises/ex13-multistage/commands.sh
Executable file
|
|
@ -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
|
||||||
Loading…
Add table
Reference in a new issue