package ociwclayer

import "github.com/Microsoft/hcsshim/pkg/ociwclayer"

Package ociwclayer provides functions for importing and exporting Windows container layers from and to their OCI tar representation.

Index

Functions

func ExportLayerToTar

func ExportLayerToTar(ctx context.Context, w io.Writer, path string, parentLayerPaths []string) error

ExportLayerToTar writes an OCI layer tar stream from the provided on-disk layer. The caller must specify the parent layers, if any, ordered from lowest to highest layer.

The layer will be mounted for this process, so the caller should ensure that it is not currently mounted.

func ImportLayerFromTar

func ImportLayerFromTar(ctx context.Context, r io.Reader, path string, parentLayerPaths []string) (int64, error)

ImportLayerFromTar reads a layer from an OCI layer tar stream and extracts it to the specified path. The caller must specify the parent layers, if any, ordered from lowest to highest layer.

The caller must ensure that the thread or process has acquired backup and restore privileges.

This function returns the total size of the layer's files, in bytes.

Source Files

export.go import.go

Version
v0.9.12
Published
Jun 27, 2024
Platform
js/wasm
Imports
11 packages
Last checked
3 hours ago

Tools for package owners.