Skip to main content

image_fs_for

Function image_fs_for 

Source
pub fn image_fs_for(
    bootstrap_path: &Path,
    blobs_dir: &Path,
    image_id: &str,
    sandbox_dir: &Path,
) -> Result<impl FsMount>
Expand description

Build an ImageFs for image_id.

  • bootstrap_path — the image’s RAFS bootstrap (.meta).
  • blobs_dir — the image store’s blobs directory (RAFS data blobs).
  • image_id — the image identifier (used as the RAFS instance id).
  • sandbox_dir — the per-sandbox directory; the writable upper + work dirs are created under <sandbox_dir>/rootfs/.

Returns the image FsMount: the RAFS image is the read-only lower, a per-sandbox directory is the writable upper, composed via OverlayFs. The shared image (RAFS bootstrap + blobs) is never written to — copy-ups and whiteouts land in the upper. Mount it wherever the namespace recipe chooses; at / it is the root purely by virtue of the mount position.