oras

package
v1.0.0-rc.2.3 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: BSD-3-Clause Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SifDefaultTag is the tag to use when a tag is not specified
	SifDefaultTag = "latest"

	// SifConfigMediaTypeV1 is the config descriptor mediaType
	// Since we only ever send a null config this should not have the
	// format extension appended:
	//   https://github.com/deislabs/oras/#pushing-artifacts-with-single-files
	//   If a null config is passed, the config extension must be removed.
	SifConfigMediaTypeV1 = "application/vnd.sylabs.sif.config.v1"

	// SifLayerMediaTypeV1 is the mediaType for the "layer" which contains the actual SIF file
	SifLayerMediaTypeV1 = "application/vnd.sylabs.sif.layer.v1.sif"

	// SifLayerMediaTypeProto is the mediaType from prototyping and Apptainer
	// <3.7 which unfortunately includes a typo and doesn't have a version suffix
	// See: https://github.com/apptainer/singularity/issues/4437
	SifLayerMediaTypeProto = "appliciation/vnd.sylabs.sif.layer.tar"
)

Variables

This section is empty.

Functions

func DownloadImage

func DownloadImage(ctx context.Context, imagePath, ref string, ociAuth *ocitypes.DockerAuthConfig) error

DownloadImage downloads a SIF image specified by an oci reference to a file using the included credentials

func ImageHash

func ImageHash(filePath string) (result string, err error)

ImageHash returns the appropriate hash for a provided image file

e.g. sha256:<sha256>

func ImageSHA

func ImageSHA(ctx context.Context, uri string, ociAuth *ocitypes.DockerAuthConfig) (string, error)

ImageSHA returns the sha256 digest of the SIF layer of the OCI manifest oci spec dictates only sha256 and sha512 are supported at time creation for this function sha512 is currently optional for implementations, this function will return an error when encountering such digests. https://github.com/opencontainers/image-spec/blob/master/descriptor.md#registered-algorithms

func Pull

func Pull(ctx context.Context, imgCache *cache.Handle, pullFrom, tmpDir string, ociAuth *ocitypes.DockerAuthConfig) (imagePath string, err error)

Pull will pull an oras image to the cache or direct to a temporary file if cache is disabled

func PullToFile

func PullToFile(ctx context.Context, imgCache *cache.Handle, pullTo, pullFrom, tmpDir string, ociAuth *ocitypes.DockerAuthConfig) (imagePath string, err error)

PullToFile will pull an oras image to the specified location, through the cache, or directly if cache is disabled

func UploadImage

func UploadImage(ctx context.Context, path, ref string, ociAuth *ocitypes.DockerAuthConfig) error

UploadImage uploads the image specified by path and pushes it to the provided oci reference, it will use credentials if supplied

Types

This section is empty.

Jump to

Keyboard shortcuts

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