diff options
author | Ian Lewis <ianmlewis@gmail.com> | 2019-03-29 22:40:11 -0400 |
---|---|---|
committer | Ian Lewis <ianmlewis@gmail.com> | 2019-03-29 22:40:11 -0400 |
commit | 22f1890a9beab11d8cfdceba3a4d66f8bbbb468c (patch) | |
tree | 110ec3a84a72560244ee4476852295b86a737eb0 /content/docs/user_guide/oci.md |
Initial commit
Diffstat (limited to 'content/docs/user_guide/oci.md')
-rw-r--r-- | content/docs/user_guide/oci.md | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/content/docs/user_guide/oci.md b/content/docs/user_guide/oci.md new file mode 100644 index 000000000..49b94bdd3 --- /dev/null +++ b/content/docs/user_guide/oci.md @@ -0,0 +1,53 @@ ++++ +title = "OCI Quick Start" +weight = 20 ++++ +This guide will quickly get you started running your first gVisor sandbox +container using the runtime directly with the default platform. + +## Install gVisor + +{{% readfile file="docs/includes/install_gvisor.md" markdown="true" %}} + +## Run an OCI compatible container + +Now we will create an [OCI][oci] container bundle to run our container. First we +will create a root directory for our bundle. + +```bash +{ + mkdir bundle + cd bundle +} +``` + +Create a root file system for the container. We will use the Docker hello-world +image as the basis for our container. + +```bash +{ + mkdir rootfs + docker export $(docker create hello-world) | tar -xf - -C rootfs +} +``` + +Next, create an specification file called `config.json` that contains our +container specification. We will update the default command it runs to `/hello` +in the `hello-world` container. + +```bash +{ + runsc spec + sed -i 's;"sh";"/hello";' config.json +} +``` + +Finally run the container. + +```bash +sudo runsc run hello +``` + +Next try [running gVisor using Docker](../docker/). + +[oci]: https://opencontainers.org/ |