Crate containerd_snapshots

Source
Expand description

Remote snapshotter extension for containerd.

Snapshots crate implements containerd’s proxy plugin for snapshotting. It aims hide the underlying complexity of GRPC interfaces, streaming and request/response conversions and provide one crate::Snapshotter trait to implement.

§Proxy plugins

A proxy plugin is configured using containerd’s config file and will be loaded alongside the internal plugins when containerd is started. These plugins are connected to containerd using a local socket serving one of containerd’s GRPC API services. Each plugin is configured with a type and name just as internal plugins are.

§How to use from containerd

Add the following to containerd’s configuration file:

[proxy_plugins]
  [proxy_plugins.custom]
    type = "snapshot"
    address = "/tmp/snap2.sock"

Start containerd daemon:

containerd --config /path/config.toml

Run remote snapshotter instance:

$ cargo run --example snapshotter /tmp/snap2.sock

Now specify custom snapshotter when pulling an image with ctr:

$ ctr i pull --snapshotter custom docker.io/library/hello-world:latest

Re-exports§

pub use tonic;

Modules§

api
Generated GRPC apis.

Structs§

Info
Information about a particular snapshot.
Usage
Defines statistics for disk resources consumed by the snapshot.

Enums§

Kind
Snapshot kinds.

Traits§

Snapshotter
Snapshotter defines the methods required to implement a snapshot snapshotter for allocating, snapshotting and mounting filesystem changesets. The model works by building up sets of changes with parent-child relationships.

Functions§

server
Helper to create snapshots server from any object that implements Snapshotter trait.