Add bind mount support to libfuse-fs for rootless container volumes #5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Container scenarios require mounting host directories (proc, sys, dev) into overlay merged layers without CAP_SYS_ADMIN. This adds user-space bind mount management to passthroughfs, enabling volume mounts via kernel bind mount with sudo.
Changes
Core Implementation
bind_mounts: HashMap<PathBuf, PathBuf>toConfigfor target→source mappingssetup_bind_mounts()duringPassthroughFs::import()usingsudo mount --bindcleanup_bind_mounts()method (Drop implementation deferred to avoid premature cleanup during Arc wrapping)API Extensions
PassthroughArgsandOverlayArgswithbind_mounts: Vec<(String, String)>fieldCLI Support
passthroughandoverlayfs_exampleaccept repeatable--bind "target:source"flagUsage
sudo ./target/debug/examples/overlayfs_example \ --mountpoint /root/merged \ --upperdir /root/upper \ --lowerdir /root/ubuntu-rootfs \ --bind "proc:/proc" \ --bind "sys:/sys" \ --bind "dev:/dev" \ --privilegedProgrammatically:
Testing
Added
bind_passthrough_test.shandbind_overlay_test.shcovering:Technical Notes
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.