I’ve been experimenting with volumes/mounts/tmpfs and storage drivers and i’ve yet to figure out how to do this.
For example, mount /home from the host to /home in the container. If I create a new file /home/foo in the container, no file would be created on the host.
Figured this out. I had to create an overlay mount with my homedir as the lower and a /tmp dir as the upper and mounted the overlay into the container as /home.
At this point /tmp/test/overlay is a combined view of /home and /tmp/test/upper. Mounting that directory into the container as a volume means that any writes will happen in /tmp/test/upper but inside the container it’ll look like the writes are to /home.