Hello community,
I’m looking for the best way to expose a mounted folder from a container back to the main host machine (macOS or Windows).
A critical limitation is that I cannot install FUSE on the host machine.
My simplified example uses the following volume flag:
docker run --rm -it \
--privileged \
--user root \
-v ./local:/mnt/minimal_folder:rshared \
alpine:latest sh -c "
mount -t ramfs ramfs /mnt/minimal_folder &&
echo 'ramfs mounted successfully' &&
df -h /mnt/minimal_folder &&
echo 'Testing write...' &&
echo 'Hello World' > /mnt/minimal_folder/test.txt &&
cat /mnt/minimal_folder/test.txt && sleep 300
"
This seems like a common requirement, and I’m curious how others approach it. Specifically, how can I achieve this without using the rshared option?
My initial ideas are:
- Two-Volume Setup: Mount the first volume, mount the second volume for exposure, and use bi-directional synchronization.
- Network Share: Expose the folder via Samba or NFS.
Are there any other existing or preferred methods for implementing this?
Thank you in advance for your insights!