pub struct Overlay {
pub lower: Vec<PathBuf>,
pub upper: PathBuf,
pub work: PathBuf,
pub merged: PathBuf,
pub userxattr: bool,
}Expand description
The directories of one overlay mount: read-only lower layers (top first), and the container’s own upper, work and merged directories.
Overlay::prepare only creates directories; mounting is the caller’s
(mount -t overlay overlay -o <mount_data> <merged>, or the equivalent
mount(2)), since it needs privileges this crate does not assume. The
mount data must fit one page (4096 bytes); with long store paths and many
layers, mount from inside the store with relative lower paths.
Fields§
§lower: Vec<PathBuf>§upper: PathBuf§work: PathBuf§merged: PathBuf§userxattr: boolMount with userxattr (markers in user.overlay.*, user namespaces).
Implementations§
Source§impl Overlay
impl Overlay
Sourcepub fn prepare(lower: Vec<PathBuf>, dir: &Path) -> Result<Self>
pub fn prepare(lower: Vec<PathBuf>, dir: &Path) -> Result<Self>
Create <dir>/{upper,work,merged} over lower (topmost first).
Sourcepub fn for_layers(
layers: &[PathBuf],
dir: &Path,
xattr: OverlayXattr,
) -> Result<Self>
pub fn for_layers( layers: &[PathBuf], dir: &Path, xattr: OverlayXattr, ) -> Result<Self>
An overlay over image layers given bottom first (as
crate::LayerStore::image_layers returns them), with the xattr
namespace the layers were unpacked with.
Sourcepub fn stack(layers: &[PathBuf]) -> Vec<PathBuf>
pub fn stack(layers: &[PathBuf]) -> Vec<PathBuf>
The lowerdir order for image layers given bottom first: top first, and a layer that repeats only at its topmost place (overlayfs refuses a lower directory twice; the upper copy re-applies everything the lower one did).
Sourcepub fn create(&self) -> Result<()>
pub fn create(&self) -> Result<()>
Create the upper, work and merged directories of an overlay laid out by the caller.
Sourcepub fn mount_data(&self) -> String
pub fn mount_data(&self) -> String
The overlayfs mount data, with \, , and : in paths escaped.