buildinstruction

package
v0.8.5 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const ArchReg = "${ARCH}"

Variables

This section is empty.

Functions

func GenerateSourceFilesDigest

func GenerateSourceFilesDigest(root, src 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

func ParseCopyLayerContent

func ParseCopyLayerContent(layerValue string) (src, dst string)

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)

type ExecContext

type ExecContext struct {
	BuildContext string
	BuildArgs    map[string]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(buildContext string, buildArgs map[string]string, useCache bool, layerStore store.LayerStore) ExecContext

type InstructionContext

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

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 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