summaryrefslogtreecommitdiffstats
path: root/crates/runner/src/init.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/runner/src/init.rs')
-rw-r--r--crates/runner/src/init.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/crates/runner/src/init.rs b/crates/runner/src/init.rs
index b2ebbe3..07631ea 100644
--- a/crates/runner/src/init.rs
+++ b/crates/runner/src/init.rs
@@ -54,16 +54,18 @@ pub fn init_runner() -> Result<()> {
fs::mkdir(paths::LAYER_STATE_DIR)?;
fs::mkdir(paths::OUTPUT_STATE_DIR)?;
- mount::mount::<_, _, _, str>(
- Some("buildtmp"),
+ fs::ensure_removed(paths::TMP_DIR)?;
+ fs::mkdir(paths::TMP_DIR)?;
+ mount::mount::<_, _, str, str>(
+ Some(paths::TMP_DIR),
paths::TMP_DIR,
- Some("tmpfs"),
- MsFlags::empty(),
+ None,
+ MsFlags::MS_BIND,
None,
)
- .context("Mounting build tmpfs failed")?;
+ .context("Failed to bind mount build tmpdir")?;
mount::mount::<str, _, str, str>(None, paths::TMP_DIR, None, MsFlags::MS_PRIVATE, None)
- .context("Failed to set MS_PRIVATE for build tmpfs")?;
+ .context("Failed to set MS_PRIVATE for build tmpdir")?;
prepare_rootfs(paths::ROOTFS_DIR)?;