Add shared_directories preset parameter (#35)

This commit is contained in:
James McMurray
2020-03-26 19:57:46 +01:00
committed by GitHub
parent 14347710ce
commit bc9969a0db
6 changed files with 100 additions and 12 deletions

View File

@@ -38,6 +38,24 @@ impl<'a> MountStack<'a> {
Ok(())
}
pub fn bind_mount(
&mut self,
source: PathBuf,
target: PathBuf,
options: Option<&str>,
) -> nix::Result<()> {
debug!("Mounting {:?} to {:?}", source, target);
mount::<_, _, str, _>(
Some(&source),
&target,
None,
MsFlags::MS_BIND | MsFlags::MS_NOATIME, // Read-only flag has no effect for bind mounts
options,
)?;
self.targets.push(target);
Ok(())
}
fn _umount(&mut self) -> Result<(), Error> {
let mut result = Ok(());