13 lines
430 B
Bash
Executable file
13 lines
430 B
Bash
Executable file
#!/bin/bash
|
|
# Exercise 6 — Bind Mounts
|
|
|
|
# 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 (Ctrl+C to exit, or: podman stop reader)
|
|
podman run --name reader -v /tmp:/data busybox tail -f /data/output
|
|
|
|
# Cleanup
|
|
podman stop writer reader && podman rm writer reader
|
|
rm -f /tmp/output
|