podman-socket-only.sh 821 B

1234567891011121314151617181920212223
  1. #!/usr/bin/env bash
  2. # Thin example: model/data container talks to host hthd via bind-mounted sockets only.
  3. # Do NOT map serial devices. Do NOT use --privileged.
  4. set -euo pipefail
  5. IMAGE="${1:-localhost/hth-client:dev}"
  6. # Observe-only (data people)
  7. podman run --rm -it \
  8. --network=none \
  9. --user 1000:1000 \
  10. --security-opt no-new-privileges \
  11. --volume /run/hth/observe.sock:/run/hth/observe.sock:ro \
  12. "$IMAGE" \
  13. python3 -c 'print("mount observe.sock only; never /dev/ttyUSB*")'
  14. # Control (model people) — still requires a Lease inside the app
  15. # podman run --rm -it \
  16. # --network=none \
  17. # --user 1000:1000 \
  18. # --security-opt no-new-privileges \
  19. # --volume /run/hth/observe.sock:/run/hth/observe.sock:ro \
  20. # --volume /run/hth/control.sock:/run/hth/control.sock \
  21. # "$IMAGE" python3 /app/control.py