From b9c2598a63dcd99d681bcd163567bd5a90ee5cdd Mon Sep 17 00:00:00 2001 From: "James O. D. Hunt" Date: Fri, 27 Jul 2018 11:06:15 +0100 Subject: [PATCH] docs: Add standalone details to dev guide Explain how to create an OCI bundle and launch the runtime directly. Fixes #199. Signed-off-by: James O. D. Hunt --- Developer-Guide.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/Developer-Guide.md b/Developer-Guide.md index 41e8a56973..6ded46932b 100644 --- a/Developer-Guide.md +++ b/Developer-Guide.md @@ -47,6 +47,9 @@ * [Create a container](#create-a-container) * [Connect to the virtual machine using the debug console](#connect-to-the-virtual-machine-using-the-debug-console) * [Obtain details of the image](#obtain-details-of-the-image) + * [Running standalone](#running-standalone) + * [Create an OCI bundle](#create-an-oci-bundle) + * [Launch the runtime to create a container](#launch-the-runtime-to-create-a-container) # Warning @@ -688,3 +691,30 @@ file exists and contains details of the image and how it was created: ``` $ cat /var/lib/osbuilder/osbuilder.yaml ``` + +## Running standalone + +It is possible to start the runtime without a container manager. This is +mostly useful for testing and debugging purposes. + +### Create an OCI bundle + +To build an +[OCI bundle](https://github.com/opencontainers/runtime-spec/blob/master/bundle.md), +required by the runtime: + +``` +$ bundle="/tmp/bundle" +$ rootfs="$bundle/rootfs" +$ mkdir -p "$rootfs" && (cd "$bundle" && kata-runtime spec) +$ sudo docker export $(sudo docker create busybox) | tar -C "$rootfs" -xvf - +``` + +### Launch the runtime to create a container + +Run the runtime standalone by providing it with the path to the +previously-created [OCI bundle](#create-an-oci-bundle): + +``` +$ sudo kata-runtime --log=/dev/stdout run --bundle "$bundle" foo +```