buildinstruction

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateSourceFilesDigest

func GenerateSourceFilesDigest(path string) (digest.Digest, error)

func GetBaseLayersPath

func GetBaseLayersPath(layers []v1.Layer) (res []string)

GetBaseLayersPath used in build stage, where the image still has from layer

Types

type CmdInstruction

type CmdInstruction struct {
	// contains filtered or unexported fields
}

func NewCmdInstruction

func NewCmdInstruction(ctx InstructionContext) (*CmdInstruction, error)

func (CmdInstruction) Exec

func (c CmdInstruction) Exec(execContext ExecContext) (out Out, err error)

type CopyInstruction

type CopyInstruction struct {
	// contains filtered or unexported fields
}

func NewCopyInstruction

func NewCopyInstruction(ctx InstructionContext) (*CopyInstruction, error)

func (CopyInstruction) Exec

func (c CopyInstruction) Exec(execContext ExecContext) (out Out, err error)

func (CopyInstruction) SetCacheID

func (c CopyInstruction) SetCacheID(layerID digest.Digest, cID string) error

SetCacheID This function only has meaning for copy layers

type ExecContext

type ExecContext struct {
	BuildContext string
	BuildType    string
	//cache flag,will change for each layer ctx
	ContinueCache bool
	//cache chain to hit,will change for each layer ctx
	ParentID cache.ChainID
	//static method to do cache
	CacheSvc cache.Service
	Prober   image.Prober
	//used to gen layer
	LayerStore store.LayerStore
}

func NewExecContext

func NewExecContext(buildType, buildContext string, imageService image.Service, layerStore store.LayerStore) ExecContext

func NewExecContextWithoutCache

func NewExecContextWithoutCache(buildType, buildContext string, layerStore store.LayerStore) ExecContext

type InstructionContext

type InstructionContext struct {
	// dynamic method to init different instruction
	CurrentLayer *v1.Layer
	BaseLayers   []v1.Layer
	Rootfs       string
}

type Interface

type Interface interface {
	Exec(ctx ExecContext) (out Out, err error)
}

Interface Different instructions have different behavioral logic each build instruction needs handle context,store context, try cache, init hook via content,and gen layer id.

func NewInstruction

func NewInstruction(ic InstructionContext) (Interface, error)

type MountTarget

type MountTarget struct {
	TempTarget string
	TempUpper  string
	//driver.Mount will reverse lowers,so here we keep the order same with the image layer.
	LowLayers []string
	// contains filtered or unexported fields
}

func NewMountTarget

func NewMountTarget(target, upper string, lowLayers []string) (*MountTarget, error)

NewMountTarget will create temp dir if target or upper is nil. it is convenient for use in build stage

func (MountTarget) CleanUp

func (m MountTarget) CleanUp()

func (MountTarget) GetLowLayers

func (m MountTarget) GetLowLayers() []string

func (MountTarget) GetMountTarget

func (m MountTarget) GetMountTarget() string

func (MountTarget) GetMountUpper

func (m MountTarget) GetMountUpper() string

func (MountTarget) TempMount

func (m MountTarget) TempMount() error

func (MountTarget) TempUMount

func (m MountTarget) TempUMount() error

type Out

type Out struct {
	LayerID       digest.Digest
	ParentID      cache.ChainID
	ContinueCache bool
}

Jump to

Keyboard shortcuts

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