Documentation ¶
Index ¶
- Constants
- Variables
- func AddOverlay(imagePath string, overlayPath string) error
- func DataContainerLayerOffset(f *os.File) (int64, error)
- func GetSingleImage(fi *sif.FileImage) (v1.Image, error)
- func HasOverlay(imagePath string) (bool, int64, error)
- func SealOverlay(imagePath, tmpDir string) error
- func SyncOverlay(imagePath string) error
- func WriteDataContainerFromPath(path string, dst string, workDir string) error
- type ImageWriter
- type ImageWriterOpt
Constants ¶
const ( DataContainerArtifactType string = "application/vnd.sylabs.data-container.v1" EmptyConfigMediaType types.MediaType = "application/vnd.oci.empty.v1+json" )
ConfigMediaType custom media type.
const ( // TODO - Replace when exported from SIF / oci-tools SquashfsLayerMediaType types.MediaType = "application/vnd.sylabs.image.layer.v1.squashfs" )
Variables ¶
var ErrFailedSquashfsConversion = errors.New("could not convert layer to squashfs")
var Ext3LayerMediaType types.MediaType = "application/vnd.sylabs.image.layer.v1.ext3"
Functions ¶
func AddOverlay ¶ added in v4.2.0
AddOverlay adds the provided ext3 overlay file at overlayPath to the OCI-SIF at imagePath, as a new image layer.
func DataContainerLayerOffset ¶ added in v4.2.0
func GetSingleImage ¶
GetSingleImage returns a v1.Image from an OCI-SIF, that must contain a single image.
func HasOverlay ¶ added in v4.2.0
HasOverlay returns whether the OCI-SIF at imgPath has an ext3 writable final layer - an 'overlay'. If present, the offset of the overlay data in the OCI-SIF file is also returned.
func SealOverlay ¶ added in v4.2.0
SealOverlay converts an ext3 overlay into a r/o squashfs layer. If `tmpDir` is specified, then the temporary squashfs image will be created inside it. If tmpDir is the empty string, then temporary files will be created at the location returned by os.TempDir.
func SyncOverlay ¶ added in v4.2.0
SyncOverlay synchronizes the digests of the overlay, stored in the OCI structures, with its true content.
Types ¶
type ImageWriter ¶ added in v4.2.0
type ImageWriter struct {
// contains filtered or unexported fields
}
func NewImageWriter ¶ added in v4.2.0
func NewImageWriter(src ggcrv1.Image, dest, workDir string, opts ...ImageWriterOpt) (*ImageWriter, error)
NewImageWriter returns a writer, which will write an OCI image into an OCI-SIF file.
func (*ImageWriter) Write ¶ added in v4.2.0
func (w *ImageWriter) Write() error
Write will write an image to an OCI-SIF file, applying relevant mutations set via options on the ImageWriter.
type ImageWriterOpt ¶ added in v4.2.0
type ImageWriterOpt func(*ImageWriter) error
func WithArtifactType ¶ added in v4.2.0
func WithArtifactType(v string) ImageWriterOpt
WithArtifactType says the image should be written with the artifactType field defined in the OCI v1.1.0 specification to v.
func WithSquash ¶ added in v4.2.0
func WithSquash(v bool) ImageWriterOpt
WithSquash sets a flag whether to squash to a single layer.
func WithSquashFSLayers ¶ added in v4.2.0
func WithSquashFSLayers(v bool) ImageWriterOpt
WithSquashFSLayers sets a flag whether to ensure layers are written as SquashFS.