MatrixAI / Emergence

Distributed Infrastructure Orchestration
Apache License 2.0
1 stars 0 forks source link

Storage drivers for running container with runc #48

Open nzhang-zh opened 5 years ago

nzhang-zh commented 5 years ago

runc does not have features similar to Docker's storage drivers. https://github.com/opencontainers/runc/issues/1040

We need to manage separate filesystem mounts to run container in https://github.com/MatrixAI/Emergence/issues/46#issuecomment-445435614

Start with OverlayFS and/or ZFS

nzhang-zh commented 5 years ago

So far the experiments with OCI images and runc was done in the workflow below.

  1. Build an image layout and store it in Nix store.
  2. Unpack the image layout to an overlay containing rootfs and runtime config. This is also stored in Nix store.
  3. Copy the overlay from nix store to a temporary directory.
  4. Run runc from the temp dir.

With this workflow, we could replace step 3 with mounting with storage driver instead of copying.

Docker does this differently however. Instead of unpacking an image and merge its layers to produce an overlay, the image layers could directly be unpacked to layers of a union file system. In the case of OverlayFS, all image layers will be used as lower dirs.