Documentation ¶
Index ¶
- func Apply(base v1.Image, ms ...Mutation) (v1.Image, error)
- func Squash(base v1.Image) (v1.Image, error)
- func SquashSubset(base v1.Image, start, end int) (v1.Image, error)
- func SquashfsLayer(base v1.Layer, dir string, opts ...SquashfsConverterOpt) (v1.Layer, error)
- func TarFromSquashfsLayer(base v1.Layer, opts ...TarConverterOpt) (tarball.Opener, error)
- type Mutation
- type SquashfsConverterOpt
- type TarConverterOpt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
Apply performs the specified mutation(s) to a base image, returning the resulting image.
func SquashSubset ¶ added in v0.12.0
SquashSubset replaces the layers starting at start index and up to (but not including) end index with a single, squashed layer.
func SquashfsLayer ¶
SquashfsLayer converts the base layer into a layer using the squashfs format. A dir must be specified, which is used as a working directory during conversion. The caller is responsible for cleaning up dir.
By default, this will attempt to locate a suitable TAR to SquashFS converter such as 'tar2sqfs' or `sqfstar` via exec.LookPath. To specify a path to a specific converter program, consider using OptSquashfsLayerConverter.
By default, AUFS whiteout markers in the base TAR layer will be converted to OverlayFS whiteout markers in the SquashFS layer. This can be disabled, e.g. where it is known that the layer is part of a squashed image that will not have any whiteouts, using OptSquashfsSkipWhiteoutConversion.
Note - when whiteout conversion is performed the base layer will be read twice. Callers should ensure it is cached, and is not a streaming layer.
func TarFromSquashfsLayer ¶ added in v0.10.0
TarFromSquashfsLayer returns an opener that will provide a TAR conversion of the SquashFS format base layer.
TarFromSquashfsLayer may create one or more temporary files during the conversion process. By default, the directory returned by TempDir is used. To override this, consider using OptTarTempDir.
By default, this will attempt to locate a suitable SquashFS to tar converter, currently only 'sqfs2tar', via exec.LookPath. To specify a path to a specific converter program, consider using OptTarLayerConverter.
By default, OverlayFS whiteout markers in the base SquashFS layer will be converted to AUFS whiteout markers in the TAR layer. This can be disabled, e.g. where it is known that the layer is part of a squashed image that will not have any whiteouts, using OptTarSkipWhiteourConversion.
Types ¶
type Mutation ¶
type Mutation func(*image) error
func ReplaceLayers ¶
ReplaceLayers replaces all layers in the image with l.
func SetConfig ¶ added in v0.3.0
SetConfig replaces the config with the specified raw content of type t.
func SetHistory ¶
SetHistory replaces the history in an image with the specified entry.
type SquashfsConverterOpt ¶ added in v0.4.0
type SquashfsConverterOpt func(*squashfsConverter) error
SquashfsConverterOpt are used to specify squashfs converter options.
func OptSquashfsLayerConverter ¶ added in v0.4.0
func OptSquashfsLayerConverter(converter string) SquashfsConverterOpt
OptSquashfsLayerConverter specifies the converter program to use when converting from TAR to SquashFS format.
func OptSquashfsSkipWhiteoutConversion ¶ added in v0.6.0
func OptSquashfsSkipWhiteoutConversion(b bool) SquashfsConverterOpt
OptSquashfsSkipWhiteoutConversion is set to skip the default conversion of whiteout / opaque markers from AUFS to OverlayFS format.
type TarConverterOpt ¶ added in v0.10.0
type TarConverterOpt func(*tarConverter) error
TarConverterOpt are used to specify tar converter options.
func OptTarLayerConverter ¶ added in v0.10.0
func OptTarLayerConverter(converter string) TarConverterOpt
OptTarLayerConverter specifies the converter program to use when converting from SquashFS to tar format.
func OptTarSkipWhiteoutConversion ¶ added in v0.10.0
func OptTarSkipWhiteoutConversion(b bool) TarConverterOpt
OptTarSkipWhiteoutConversion is set to skip the default conversion of whiteout / opaque markers from OverlayFS to AUFS format.
func OptTarTempDir ¶ added in v0.10.0
func OptTarTempDir(d string) TarConverterOpt
OptTarTempDir sets the directory to use for temporary files. If not set, the directory returned by TempDir is used.