Skip to main content

Crate sdme

Crate sdme 

Source
Expand description

Lightweight systemd-nspawn container manager with overlayfs.

sdme manages containers backed by explicit root filesystems, keeping the base rootfs untouched via overlayfs copy-on-write. Each container gets upper/work/merged directories under the data directory and a KEY=VALUE state file that tracks its metadata.

Requires Linux with systemd (>= 252) and root privileges.

§Modules

ModulePurpose
containersCreate, remove, join, exec, stop, list
systemdD-Bus helpers and template unit management
importRootfs import (dir, tar, URL, OCI, QCOW2)
ociOCI registry, layout, app setup, blob cache
kubeKubernetes Pod YAML support
exportRootfs export (dir, tarball, raw image)
rootfsRootfs listing, removal, os-release parsing
buildBuild config parsing and rootfs build execution
configConfiguration file loading and saving
mountsBind mount and environment variable config
networkNetwork configuration and state serialization
securityCapability, seccomp, AppArmor config
system_checkVersion and dependency checks
podShared network namespace management

Re-exports§

pub use mounts::BindConfig;
pub use mounts::EnvConfig;
pub use network::NetworkConfig;
pub use security::SecurityConfig;

Modules§

build
Build root filesystems from a Dockerfile-like configuration.
config
Internal API for managing sdme configuration.
containers
Internal API for container filesystem, state, and runtime management.
export
Rootfs export: directory copy, tarball creation, raw disk image.
import
Rootfs import logic: directory copy, tarball extraction, URL download, OCI image, registry pull, and QCOW2 support.
kube
Kubernetes Pod YAML support for sdme.
mounts
Bind mount and environment variable configuration for containers.
network
Network configuration for containers.
oci
OCI container image support: layout parsing, registry pulling, app setup, and caching.
pod
Pod network namespace management.
rootfs
Internal API for managing root filesystems used as overlayfs lower layers.
security
Security configuration for containers.
system_check
Runtime dependency and version checks.
systemd
Internal API for managing interactions with systemd and D-Bus.

Structs§

ResourceLimits
Resource limits that map to systemd cgroup directives.
State
Container metadata stored as KEY=VALUE pairs in a state file.
SudoUser
Information about the real user behind sudo.

Statics§

INTERRUPTED
Global flag set by the SIGINT handler; checked by check_interrupted.

Functions§

atomic_write
Write data to a file atomically via a temporary file and rename.
check_interrupted
Return Err if the global SIGINT flag is set.
confirm
Prompt the user for yes/no confirmation, returning Ok(true) for “y”.
confirm_default_yes
Prompt the user for yes/no confirmation, returning Ok(true) for “y” or empty input (Enter). Only “n”/“no” returns false.
install_interrupt_handler
Install the SIGINT handler that sets the global INTERRUPTED flag.
parse_size
Parse a human-readable size string (e.g. “10G”, “512M”) into bytes.
read_line_interruptible
Read a line from stdin, returning ErrorKind::Interrupted if a signal interrupts the read.
reset_interrupt
Reset the interrupt flag and re-install the signal handler.
sudo_user
Returns info about the real user behind sudo, if applicable.
validate_name
Validate a container name.