build

package
v0.0.0-...-6db7c32 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2026 License: Apache-2.0 Imports: 42 Imported by: 0

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

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