Documentation ¶
Overview ¶
Package layers provides a factory that can be used to construct layer tarballs from buildpack layer directories, extension layers, and other CNB filesystem constructs. The tarballs can be added as layers to any OCI image.
Index ¶
- Constants
- func Extract(r io.Reader, dest string) error
- type Factory
- func (f *Factory) DirLayer(withID string, fromDir string, createdBy string) (layer Layer, err error)
- func (f *Factory) LauncherLayer(path string) (layer Layer, err error)
- func (f *Factory) ProcessTypesLayer(config launch.Metadata) (layer Layer, err error)
- func (f *Factory) SliceLayers(dir string, slices []Slice) ([]Layer, error)
- func (f *Factory) TarLayer(withID string, fromTarPath string, createdBy string) (layer Layer, err error)
- type Layer
- type Slice
Constants ¶
const ( AppLayerName = "Application Layer" BuildpackLayerName = "Layer: '%s', Created by buildpack: %s" ExtensionLayerName = "Layer: '%s', Created by extension: %s" LauncherConfigLayerName = "Buildpacks Launcher Config" LauncherLayerName = "Buildpacks Application Launcher" ProcessTypesLayerName = "Buildpacks Process Types" SBOMLayerName = "Software Bill-of-Materials" SliceLayerName = "Application Slice: %d" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Factory ¶
type Factory struct { ArtifactsDir string // ArtifactsDir is the directory where layer files are written UID, GID int // UID and GID are used to normalize layer entries Logger log.Logger Ctx context.Context // contains filtered or unexported fields }
func (*Factory) DirLayer ¶
func (f *Factory) DirLayer(withID string, fromDir string, createdBy string) (layer Layer, err error)
DirLayer creates a layer from the given directory DirLayer will set the UID and GID of entries describing dir and its children (but not its parents)
to Factory.UID and Factory.GID
func (*Factory) LauncherLayer ¶ added in v0.9.0
LauncherLayer creates a Layer containing the launcher at path
func (*Factory) ProcessTypesLayer ¶ added in v0.9.0
ProcessTypesLayer creates a Layer containing symlinks pointing to target where:
- any parents of the symlink files will also be added to the layer
- symlinks and their parent directories shall be root owned and world readable
func (*Factory) SliceLayers ¶
SliceLayers divides dir into layers using slices using the following process: * Given n slices SliceLayers will return n+1 layers * The first n layers will contain files matched by the any Path in the nth Slice * The final layer will contain any files in dir that were not included in a previous layer Some layers may be empty
func (*Factory) TarLayer ¶ added in v0.19.0
func (f *Factory) TarLayer(withID string, fromTarPath string, createdBy string) (layer Layer, err error)
TarLayer creates a layer from the provided tar path. The provided tar may be compressed or uncompressed. TarLayer will return a layer with uncompressed data and zeroed out timestamps. FIXME: investigate if it's possible to set "no compression" in kaniko, then we can avoid decompressing layers