Skip to content

feat: add --read-only filesystem mode#38

Merged
dean0x merged 4 commits intomainfrom
feat/read-only-filesystem
Mar 9, 2026
Merged

feat: add --read-only filesystem mode#38
dean0x merged 4 commits intomainfrom
feat/read-only-filesystem

Conversation

@dean0x
Copy link
Owner

@dean0x dean0x commented Mar 7, 2026

Summary

  • Adds --read-only CLI flag and container.read_only config option to mount the container root filesystem as read-only
  • Automatically provisions tmpfs mounts at /tmp, /run, and /home/developer for writable paths when enabled
  • Off by default for compatibility; CLI flag or config option enables it

Closes #29

Test plan

  • cargo test — 277 unit + 13 integration tests pass
  • cargo clippy — no warnings
  • mino run --read-only -- ls — verify --read-only and --tmpfs in podman args (-vv)
  • mino run --read-only -- touch /test — confirm read-only root fs rejects writes
  • mino run --read-only -- touch /tmp/test — confirm tmpfs mounts are writable

Dean Sharon added 4 commits March 8, 2026 01:32
Mount container root filesystem as read-only with tmpfs at /tmp, /run,
and /home/developer for writable paths. Configurable via CLI flag or
config file. Off by default for compatibility.
Add unit tests for build_container_config read-only logic covering:
- default disabled state (no read_only, no tmpfs)
- CLI --read-only flag enables read-only + tmpfs mounts
- config container.read_only enables read-only + tmpfs mounts
- either CLI or config enables the feature (OR semantics)
Non-base images (e.g., fedora:43) run as root with home at /root,
which remained read-only — breaking shell history and dotfiles.
@dean0x dean0x merged commit 20236d5 into main Mar 9, 2026
7 checks passed
@dean0x dean0x deleted the feat/read-only-filesystem branch March 9, 2026 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add --read-only filesystem mode for containers

1 participant