Commit Graph

2 Commits (02b97364fcb315759c69d9b03fb03fdd4c7aad16)

Author SHA1 Message Date
Dustin 02b97364fc Implement run command
The `ocivm run` command launches a QEMU microvm with an imported OCI
container image as its root filesystem.  The custom init program
(`/linuxrc`) sets up the environment for the container's main process.
Configuration information are passed to the VM via a VirtIO block
device, which is read by the `/linuxrc` script.  The main process is
attached to a VirtIO serial console, which is in turn attached to the
standart input/output streams of the `ocivm` process, thus allowing the
process to be controlled interactively or redirecting its output.
The `ocivm run` command supports mounting directories from the host
(using 9pfs), setting environment variables, setting the working
directory, and specifying the command to run in the VM, using a
command-line syntax similar to `podman run`.  After the specified
command completes, the VM shuts down.

For now, `/linuxrc` is implemented in POSIX shell, and thus requires
that the container image must contain a complete userspace (including at
least *coreutils*, *util-linux*, and *iproute2*.
2023-02-26 12:25:49 -06:00
Dustin 6a31ac392a Initial commit 2023-02-24 12:00:06 -06:00