oci

package
v0.14.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 31, 2024 License: Apache-2.0 Imports: 31 Imported by: 3

Documentation

Index

Constants

View Source
const (
	LocalDomain = "apko.local"
	LocalRepo   = "cache"
)

Variables

This section is empty.

Functions

func BuildImageFromLayer added in v0.7.0

func BuildImageFromLayer(ctx context.Context, baseImage v1.Image, layer v1.Layer, ic types.ImageConfiguration, created time.Time, arch types.Architecture) (oci.SignedImage, error)

func BuildImageTarballFromLayer

func BuildImageTarballFromLayer(ctx context.Context, imageRef string, layer v1.Layer, outputTarGZ string, ic types.ImageConfiguration, opts options.Options) error

func BuildIndex added in v0.7.0

func BuildIndex(outfile string, idx oci.SignedImageIndex, tags []string) (name.Digest, error)

BuildIndex builds a self-contained tar.gz file containing the index and its individual images for all architectures. Returns the digest and the path to the combined tar.gz.

func Copy added in v0.6.0

func Copy(ctx context.Context, src, dst string, remoteOpts ...remote.Option) error

Copt copies an image from one registry repository to another.

func GenerateDockerIndex added in v0.9.0

GenerateDockerIndex generates a docker multi-arch manifest from the given imgs. The index type will be "application/vnd.docker.distribution.manifest.list.v2+json". The index is stored in memory.

func GenerateIndex added in v0.9.0

GenerateIndex generates an OCI image index from the given imgs. The index type will be "application/vnd.oci.image.index.v1+json". The index is stored in memory.

func LoadImage added in v0.10.0

func LoadImage(ctx context.Context, image oci.SignedImage, tags []string) (name.Reference, error)

func LoadIndex added in v0.10.0

func LoadIndex(ctx context.Context, idx oci.SignedImageIndex, tags []string) (name.Reference, error)

If attempting to save locally, pick the native architecture and use that cached image for local tags Ported from https://github.com/ko-build/ko/blob/main/pkg/publish/daemon.go#L92-L168

func PostAttachSBOM added in v0.5.0

func PostAttachSBOM(ctx context.Context, si oci.SignedEntity, sboms []types.SBOM,
	platform *v1.Platform, tags []string, remoteOpts ...remote.Option) (oci.SignedEntity, error)

PostAttachSBOM attaches the sboms to a single already published image

func PostAttachSBOMsFromIndex added in v0.9.0

func PostAttachSBOMsFromIndex(ctx context.Context, idx oci.SignedImageIndex, sboms []types.SBOM,
	tags []string, remoteOpts ...remote.Option) error

PostAttachSBOMsFromIndex attaches SBOMs to an already published index and all of the referenced images

func PublishImage added in v0.9.0

func PublishImage(ctx context.Context, image oci.SignedImage, shouldPushTags bool, tags []string, remoteOpts ...remote.Option) (name.Digest, error)

PublishImage publishes an image to a registry. `local` determines if it should push to the local docker daemon or to the actual registry. `shouldPushTags` determines whether to push the tags provided in the `tags` parameter, or whether to treat the first tag as a digest and push that instead.

func PublishImagesFromIndex added in v0.9.0

func PublishImagesFromIndex(ctx context.Context, idx oci.SignedImageIndex, repo name.Repository, remoteOpts ...remote.Option) ([]name.Digest, error)

PublishImagesFromIndex publishes all images from an index to a remote registry. The only difference between this and PublishIndex is that PublishIndex pushes out all blobs and referenced manifests from within the index. This adds pushing the referenced SignedImage artifacts along with appropriate tags.

func PublishIndex added in v0.2.0

func PublishIndex(ctx context.Context, idx oci.SignedImageIndex, tags []string, remoteOpts ...remote.Option) (name.Digest, error)

PublishIndex given an oci.SignedImageIndex, publish it to a registry. `local` causes it to publish to the local docker daemon instead of the registry. Note that docker, when provided with a multi-architecture index, will load just the image inside for the provided platform, defaulting to the one on which the docker daemon is running. PublishIndex will determine that platform and use it to publish the updated index.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL