context

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2021 License: Apache-2.0 Imports: 10 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildContext

type BuildContext struct {
	RootDir    string // Root of the build file system. Always "/" in production.
	ContextDir string // Source of copy/add operations.

	// StageVars contains the resolved values corresponding to ARG and ENV
	// directives that occurred during the current stage.
	// It's only used for setting environment variables for RUN, not for
	// updating image config, since env vars from ARG are not supposed to be
	// persisted.
	StageVars map[string]string

	// MemFS and ImageStore can be shared across all copies of the BuildContext.
	MemFS      *snapshot.MemFS     // Merged view of base layers. Layers should be merged in order.
	ImageStore *storage.ImageStore // Stores image layers and manifests.

	CopyOps  []*snapshot.CopyOperation
	MustScan bool
	// contains filtered or unexported fields
}

BuildContext stores build state for one build stage.

func BuildContextFixture

func BuildContextFixture() (*BuildContext, func())

BuildContextFixture returns a mock build stage context for testing.

func BuildContextFixtureWithSampleImage

func BuildContextFixtureWithSampleImage() (*BuildContext, func())

BuildContextFixtureWithSampleImage returns a mock build stage context with sample image data for testing.

func NewBuildContext

func NewBuildContext(
	rootDir, contextDir string, imageStore *storage.ImageStore) (*BuildContext, error)

NewBuildContext inits a new BuildContext object.

func (*BuildContext) Cleanup

func (ctx *BuildContext) Cleanup() error

Cleanup cleans up files kept across stages after the build is completed.

func (*BuildContext) CopyFromRoot added in v0.1.1

func (ctx *BuildContext) CopyFromRoot(alias string) string

CopyFromRoot returns the directory that context from a stage should be written to and read from.

Jump to

Keyboard shortcuts

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