Documentation ¶
Index ¶
- Constants
- Variables
- func Build(ctx context.Context, configPath, closurePath, copyToRootPath string, ...) (*types.Image, error)
- func Export(ctx context.Context, store content.Store, image *types.Image, ref string, ...) error
- func Generate(ctx context.Context, image *types.Image, store content.Store) (desc ocispec.Descriptor, err error)
- func Load(ctx context.Context, client *containerd.Client, archivePath string) (containerd.Image, error)
- func Push(ctx context.Context, store content.Store, archivePath, ref string, ...) error
- func TempDir() string
- type BuildOpt
- type BuildOpts
- type PushConfig
- type PushOpt
Constants ¶
View Source
const ( // NixLayerAnnotation is a remote snapshot OCI annotation to indicate that // it will also contain annotations with NixStorePrefixAnnotation. NixLayerAnnotation = "containerd.io/snapshot/nix-layer" // NixStorePrefixAnnotation is a prefix for remote snapshot OCI annotations // for each nix store path that the layer will need. NixStorePrefixAnnotation = "containerd.io/snapshot/nix-store-path." )
Variables ¶
View Source
var ( // ImageRefPrefix is part of the canonical image reference for images built // for nix-snapshotter in the format "nix:0/nix/store/*.tar". // // Leading slash is not allowed for image references, so we needed a distinct // prefix for nix-snapshotter to distinguish regular references from nix // references. If nix-snapshotter is configured as the CRI image service, // it will be able to resolve the image manifest with nix rather than a // Docker Registry. ImageRefPrefix = "nix:0" )
Functions ¶
func Build ¶
func Build(ctx context.Context, configPath, closurePath, copyToRootPath string, opts ...BuildOpt) (*types.Image, error)
Build builds an image specification.
func Export ¶
func Export(ctx context.Context, store content.Store, image *types.Image, ref string, w io.Writer) error
Export writes an OCI archive to the writer using the provided nix image spec.
func Generate ¶
func Generate(ctx context.Context, image *types.Image, store content.Store) (desc ocispec.Descriptor, err error)
Generate adds a nix-snapshotter container image to store and returns its descriptor.
func Load ¶
func Load(ctx context.Context, client *containerd.Client, archivePath string) (containerd.Image, error)
Types ¶
type BuildOpt ¶
type BuildOpt func(*BuildOpts)
BuildOpt applies changes to BuildOptions
func WithFromImage ¶
WithFromImage specifies a base image to build the image from.
type BuildOpts ¶
type BuildOpts struct {
FromImage string
}
BuildOpts contains options concerning how nix images are built.
type PushConfig ¶
type PushConfig struct {
PlainHTTP bool
}
Click to show internal directories.
Click to hide internal directories.