build

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

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

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

Documentation

Index

Constants

View Source
const (
	// Name used to identify the content store.
	KeyContentStoreName = "container"
	// Base64-encoded Dockerfile contents.
	KeyDockerfile = "dockerfile"
	// Hidden directory for the dockerfile and dockerignore to be placed.
	// This is provided when docker specific ignore file is found, which might live outside the build context.
	KeyHiddenDockerDir = "hidden-docker-dir"
	// 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"
	// 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 (
	GlobalExportPath = "/var/lib/container-builder-shim/exports"
)

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
	Tag             string
	ContextDir      string
	HiddenDockerDir string
	BuildPlatforms  []ocispecs.Platform
	Platforms       []ocispecs.Platform
	NoCache         bool
	Target          string
	BuildArgs       map[string]string
	Secrets         map[string][]byte
	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