package archive

import "github.com/containerd/containerd/images/archive"

Package archive provides a Docker and OCI compatible importer

Index

Functions

func AddRefPrefix

func AddRefPrefix(image string) func(string) string

AddRefPrefix prepends the given image prefix to tag-only references, while leaving returning full references unmodified.

func DigestTranslator

func DigestTranslator(prefix string) func(digest.Digest) string

DigestTranslator creates a digest reference by adding the digest to an image name

func Export

func Export(ctx context.Context, store content.Provider, writer io.Writer, opts ...ExportOpt) error

Export implements Exporter.

func FilterRefPrefix

func FilterRefPrefix(image string) func(string) string

FilterRefPrefix restricts references to having the given image prefix. Tag-only references will have the prefix prepended.

func ImportIndex

func ImportIndex(ctx context.Context, store content.Store, reader io.Reader, opts ...ImportOpt) (ocispec.Descriptor, error)

ImportIndex imports an index from a tar archive image bundle

Types

type BlobFilter

type BlobFilter func(ocispec.Descriptor) bool

BlobFilter returns false if the blob should not be included in the archive.

type ExportOpt

type ExportOpt func(context.Context, *exportOptions) error

ExportOpt defines options for configuring exported descriptors

func WithAllPlatforms

func WithAllPlatforms() ExportOpt

WithAllPlatforms exports all manifests from a manifest list. Missing content will fail the export.

func WithBlobFilter

func WithBlobFilter(f BlobFilter) ExportOpt

WithBlobFilter specifies BlobFilter.

func WithImage

func WithImage(is images.Store, name string) ExportOpt

WithImage adds the provided images to the exported archive.

func WithImages

func WithImages(imgs []images.Image) ExportOpt

WithImages adds multiples images to the exported archive.

func WithManifest

func WithManifest(manifest ocispec.Descriptor, names ...string) ExportOpt

WithManifest adds a manifest to the exported archive. When names are given they will be set on the manifest in the exported archive, creating an index record for each name. When no names are provided, it is up to caller to put name annotation to on the manifest descriptor if needed.

func WithPlatform

func WithPlatform(p platforms.MatchComparer) ExportOpt

WithPlatform defines the platform to require manifest lists have not exporting all platforms. Additionally, platform is used to resolve image configs for Docker v1.1, v1.2 format compatibility.

func WithSkipDockerManifest

func WithSkipDockerManifest() ExportOpt

WithSkipDockerManifest skips creation of the Docker compatible manifest.json file.

func WithSkipNonDistributableBlobs

func WithSkipNonDistributableBlobs() ExportOpt

WithSkipNonDistributableBlobs excludes non-distributable blobs such as Windows base layers.

type ImportOpt

type ImportOpt func(*importOpts) error

ImportOpt is an option for importing an OCI index

func WithImportCompression

func WithImportCompression() ImportOpt

WithImportCompression compresses uncompressed layers on import. This is used for import formats which do not include the manifest.

Source Files

exporter.go importer.go reference.go

Version
v1.7.8
Published
Oct 26, 2023
Platform
js/wasm
Imports
22 packages
Last checked
15 minutes ago

Tools for package owners.