CRI-O/Podman Nydus Store Plugin

The project is an implementation of additional layer store plugin of CRI-O/Podman, it provides CRI-O/Podman with the ability to lazy mount nydus images.

⚠️ This project is still in progress, see more details in this proposal.

asciicast

Quick Start

  1. Build store plugin

$ git clone https://github.com/containers/nydus-storage-plugin.git
$ cd nydus-storage-plugin
$ go build cmd/store/main.go
  1. Install nydusd

Download nydus binaries from nydus release page, and then install with the command below:

$ tar xzvf nydus-static-$version-linux-amd64.tgz
$ sudo mv nydus-static/nydusd-fusedev /usr/bin/nydusd
$ sudo mv nydus-static/nydusify /usr/bin/nydusify
$ sudo mv nydus-static/nydus-image /usr/bin/nydus-image
  1. Configure podman

Get an /etc/containers/storage.conf example from here, and add with [storage.options] section like:

[storage.options]
additionallayerstores = [
  "/var/lib/nydus-store/store:ref"
]

Make sure you have created the directory with mkdir -p /var/lib/nydus-store/store.

  1. Run store plugin

Prepare a nydus configuration JSON file like below, named as /etc/nydusd-config.json:

{
  "device": {
    "backend": {
      "type": "registry",
      "config": {
        "scheme": "http",
        "timeout": 5,
        "connect_timeout": 5,
        "retry_limit": 2
      }
    },
    "cache": {
      "type": "blobcache",
      "config": {
        "work_dir": "/var/lib/nydus/cache"
      }
    }
  },
  "mode": "direct",
  "digest_validate": false,
  "iostats_files": false,
  "enable_xattr": true,
  "fs_prefetch": {
    "enable": true,
    "threads_count": 2
  }
}
$ sudo ./store --log-to-stdout --log-level debug --config-path /etc/nydusd-config.json --root /var/lib/nydus-store
  1. Convert a nydus image

# Prepare a local registry
$ podman run -d -it -p 5000:5000 --name registry docker.io/library/registry:2

# Convert OCI v1 image to nydus image:
$ sudo nydusify convert --source ubuntu --target localhost:5000/ubuntu:latest-nydus
  1. Run container with nydus image
$ sudo podman run -it --tls-verify=false --rm localhost:5000/ubuntu:latest-nydus /bin/bash

GitHub

View Github