build

package
v0.0.0-...-1058d05 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 42 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// Name used to identify the content store.
	KeyContentStoreName = "container"
	// Base64-encoded Dockerfile contents.
	KeyDockerfile = "dockerfile"
	// Base64-encoded Dockerignore contents.
	KeyDockerignore = "dockerignore"
	// Image reference (name:tag) to assign to the built image.
	KeyTag = "tag"
	// Target platforms to build the image for.
	KeyPlatforms = "platforms"
	// Progress output mode: auto, tty, or plain.
	KeyProgress = "progress"
	// When present, disables layer caching.
	KeyNoCache = "no-cache"
	// Build context directory path.
	KeyContext = "context"
	// Dockerfile stage to build up to.
	KeyTarget = "target"
	// Key=value metadata labels to apply to the image.
	KeyLabels = "labels"
	// ARG key=value pairs passed to the Dockerfile.
	KeyBuildArgs = "build-args"
	// RUN --mount=type=secret,... id:value pairs passed to the Dockerfile.
	KeySecrets = "secrets"
	// SSH agent to forward during the build process.
	KeySSH = "ssh"
	// Cache import sources.
	KeyCacheIn = "cache-in"
	// Cache export destinations.
	KeyCacheOut = "cache-out"
	// Additional export destinations.
	KeyOutput = "outputs"
	// Unique build identifier.
	KeyBuildID = "build-id"
)
View Source
const (
	// Used to share built artifacts outside VM
	GlobalExportPath = "/var/lib/container-builder-shim/exports"
	// If KeyDockerignore argument is provided, Dockerfile and ignore file are
	// staged at DockerfileStaging directory, and buildkit uses them.
	DockerfileStaging = fssync.DockerfileStaging
)

Variables

View Source
var (
	ErrMissingBuildID            = fmt.Errorf("build ID is missing")
	ErrInvalidGatewayRequest     = fmt.Errorf("invalid request to gateway")
	ErrMissingContext            = fmt.Errorf("context missing")
	ErrMissingContextDockerfile  = fmt.Errorf("dockerfile missing in build context")
	ErrMissingContextRef         = fmt.Errorf("ref missing in build context")
	ErrTypeAssertionFail         = fmt.Errorf("type assertion failed")
	ErrNoBuildDirectives         = fmt.Errorf("no build directives")
	ErrInvalidImageContextFormat = fmt.Errorf("image resolver: image name format is invalid")
	ErrInvalidProgress           = fmt.Errorf("build arg progress value is invalid")
	ErrUnsupportedSSH            = fmt.Errorf("build arg ssh value is not supported")
)

Functions

func Build

func Build(ctx context.Context, opts *BOpts) error

Types

type BOpts

type BOpts struct {
	BuildID        string
	Dockerfile     []byte
	Dockerignore   []byte
	Tag            string
	ContextDir     string
	BuildPlatforms []ocispecs.Platform
	Platforms      []ocispecs.Platform
	NoCache        bool
	Target         string
	BuildArgs      map[string]string
	Secrets        map[string][]byte
	SSH            []sshprovider.AgentConfig
	CacheIn        []string
	CacheOut       []string
	Outputs        []string
	Labels         map[string]string
	ProgressWriter progresswriter.Writer

	ContentStore *content.ContentStoreProxy
	Resolver     *resolver.ResolverProxy
	FSSync       *fssync.FSSyncProxy
	Stdio        *stdio.StdioProxy
	// contains filtered or unexported fields
}

func NewBuildOpts

func NewBuildOpts(ctx context.Context, basePath string, contextMap map[string][]string) (*BOpts, error)

func (*BOpts) Context

func (b *BOpts) Context(parent context.Context) context.Context

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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