Documentation ¶
Overview ¶
Package archive provides a Docker and OCI compatible importer
Index ¶
- func AddRefPrefix(image string) func(string) string
- func DigestTranslator(prefix string) func(digest.Digest) string
- func Export(ctx context.Context, store content.Provider, writer io.Writer, ...) error
- func FilterRefPrefix(image string) func(string) string
- func ImportIndex(ctx context.Context, store content.Store, reader io.Reader, opts ...ImportOpt) (ocispec.Descriptor, error)
- type ExportOpt
- func WithAllPlatforms() ExportOpt
- func WithImage(is images.Store, name string) ExportOpt
- func WithManifest(manifest ocispec.Descriptor) ExportOpt
- func WithNamedManifest(manifest ocispec.Descriptor, names ...string) ExportOpt
- func WithPlatform(p platforms.MatchComparer) ExportOpt
- func WithSkipDockerManifest() ExportOpt
- type ImportOpt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddRefPrefix ¶
AddRefPrefix prepends the given image prefix to tag-only references, while leaving returning full references unmodified.
func DigestTranslator ¶
DigestTranslator creates a digest reference by adding the digest to an image name
func FilterRefPrefix ¶
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
- implements Docker v1.1, v1.2 and OCI v1.
- prefers OCI v1 when provided
- creates OCI index for Docker formats
- normalizes Docker references and adds as OCI ref name e.g. alpine:latest -> docker.io/library/alpine:latest
- existing OCI reference names are untouched
Types ¶
type ExportOpt ¶
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 WithManifest ¶
func WithManifest(manifest ocispec.Descriptor) ExportOpt
WithManifest adds a manifest to the exported archive. It is up to caller to put name annotation to on the manifest descriptor if needed.
func WithNamedManifest ¶
func WithNamedManifest(manifest ocispec.Descriptor, names ...string) ExportOpt
WithNamedManifest adds a manifest to the exported archive with the provided names.
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.
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.