gvisor.dev/gvisor@v0.0.0-20240520182842-f9d4d51c7e0f/g3doc/user_guide/quick_start/oci.md (about)

     1  # OCI Quick Start
     2  
     3  This guide will quickly get you started running your first gVisor sandbox
     4  container using the runtime directly with the default platform.
     5  
     6  First, follow the [Installation guide][install].
     7  
     8  ## Run an OCI compatible container
     9  
    10  Now we will create an [OCI][oci] container bundle to run our container. First we
    11  will create a root directory for our bundle.
    12  
    13  ```bash
    14  mkdir bundle
    15  cd bundle
    16  ```
    17  
    18  Create a root file system for the container. We will use the Docker
    19  `hello-world` image as the basis for our container.
    20  
    21  ```bash
    22  mkdir --mode=0755 rootfs
    23  docker export $(docker create hello-world) | sudo tar -xf - -C rootfs --same-owner --same-permissions
    24  ```
    25  
    26  Next, create an specification file called `config.json` that contains our
    27  container specification. We tell the container to run the `/hello` program.
    28  
    29  ```bash
    30  runsc spec -- /hello
    31  ```
    32  
    33  Finally run the container.
    34  
    35  ```bash
    36  sudo runsc run hello
    37  ```
    38  
    39  Next try [using CNI to set up networking](../../../tutorials/cni/) or
    40  [running gVisor using Docker](../docker/).
    41  
    42  [oci]: https://opencontainers.org/
    43  [install]: /docs/user_guide/install