Documentation
¶
Overview ¶
Package containerdutil provides "caching" versions of containerd native snapshotter and content store. NOTE: caching should only be used for single, atomic operations, like `nerdctl images`, and NOT kept across successive, distincts operations. As such, caching is not persistent across invocations of nerdctl, and only lasts as long as the lifetime of the Snapshotter or ContentStore.
Index ¶
- Variables
- func NewProvider(client *containerd.Client) content.Provider
- func ServerSemVer(ctx context.Context, client *containerd.Client) (*semver.Version, error)
- func SnapshotService(client *containerd.Client, snapshotterName string) snapshots.Snapshotter
- func SupportsFullTransferService(ctx context.Context, client *containerd.Client) bool
- func WalkPresentChildren(ctx context.Context, store content.Store, target ocispec.Descriptor, ...) error
- type ImageStore
Constants ¶
This section is empty.
Variables ¶
var ReadBlob = readBlobWithCache()
Functions ¶
func NewProvider ¶
func NewProvider(client *containerd.Client) content.Provider
ContentStore should be called to get a Provider with caching
func ServerSemVer ¶ added in v2.3.0
func SnapshotService ¶
func SnapshotService(client *containerd.Client, snapshotterName string) snapshots.Snapshotter
SnapshotService should be called to get a new caching snapshotter
func SupportsFullTransferService ¶ added in v2.3.0
func SupportsFullTransferService(ctx context.Context, client *containerd.Client) bool
SupportsFullTransferService checks if the containerd version fully supports the Transfer service. While containerd 1.7 has Transfer service, full support is only available in 2.0+. The following features are missing in containerd 1.7:
- Non-distributable artifacts support
- Registry configuration options: WithHostDir(), WithDefaultScheme() etc.
func WalkPresentChildren ¶ added in v2.4.0
func WalkPresentChildren(ctx context.Context, store content.Store, target ocispec.Descriptor, f func(context.Context, ocispec.Descriptor) error) error
WalkPresentChildren calls f for target and for every descriptor reachable from it that is present in the content store. Descriptors that are only referenced but not stored locally (for instance the layers of an image that was pulled for another platform) are skipped, so that sizes computed from the visited descriptors reflect what is actually on disk.
Types ¶
type ImageStore ¶ added in v2.0.5
type ImageStore struct {
}