93cbf7ca47cf5224ef921059aa49b2c1b8d29ca4
--mount now accepts <host-path>:<guest-path> (Docker-style). When the guest path is omitted, the host path is used. Non-absolute guest paths are resolved against the image WORKINGDIR, which is written to /slim/workdir at build time and read by slim-init.sh at boot. Changes: - qemu.rs: Parse host:guest spec, pass guest path (not host path) on the kernel cmdline as slim.mount=<tag>:<base64(guest_path)> - inject.rs: Accept working_dir param, write /slim/workdir into rootfs - build.rs: Pass config.working_dir to inject() - slim-init.sh: Read /slim/workdir, resolve relative guest paths against it before mounting - test.sh: Test host:guest absolute paths (multi-mount) and relative guest path resolved against WORKINGDIR Addresses PR #9 review comment from @hulthe.
slim
Turning containers into bootable VMs
Example
# Build the container
podman build ./example/alpine -t slim-alpine
# Make the container bootable. slim injects /slim/init and /slim/exec,
# then packs the rootfs as a qcow2 disk.
slim build qcow2 slim-alpine
# Boot the image using QEMU. The container's CMD runs automatically.
slim run slim-alpine
# Override the command at runtime (base64-encoded on the kernel cmdline):
slim run slim-alpine --cmd '/bin/sh'
# Override the command at build time (baked into /slim/exec):
slim build qcow2 slim-alpine --cmd '/bin/sh'
# Cleanup
slim image rm slim-alpine
podman image rm slim-alpine
Kernel
slim boots VMs using a shared kernel at $XDG_DATA_HOME/slim-rs/registry/vmlinuz.
Place a suitable x86 bzImage there before running slim run.
Languages
Rust
75.1%
Shell
24.7%
Dockerfile
0.2%