build

package
v5.7.2 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 51 Imported by: 0

Documentation

Overview

Package build implements the build of the images of a project's services, with BuildKit through the buildx bake plugin or with the classic builder.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	// CLI is the Docker CLI Compose runs in: the daemon client, the credentials,
	// the terminal output and the buildx plugin all come from it.
	CLI() command.Cli
	// Events receives the progress of the builds.
	Events() api.EventProcessor
	// DryRun tells whether the build only reports what it would do.
	DryRun() bool
	// ProxyConfig is the proxy settings handed to the builds as build arguments.
	ProxyConfig() map[string]*string
	// MaxConcurrency is the upper limit of concurrent operations, <= 0 for unlimited.
	MaxConcurrency() int
	// CanonicalBuiltDigest resolves the content digest to record for an image just built.
	CanonicalBuiltDigest(ctx context.Context, imageRef, platform, builderDigest string) string
	// Push pushes the images of the project.
	Push(ctx context.Context, project *types.Project, options api.PushOptions) error
	// PrepareShellOut sets the environment of a command Compose runs.
	PrepareShellOut(ctx context.Context, env types.Mapping, cmd *exec.Cmd) error
	// PropagateDockerEndpoint produces the environment that points a child CLI
	// plugin to the same Docker endpoint; its cleanup function must be called
	// once the child process is done.
	PropagateDockerEndpoint() ([]string, func(), error)
}

Backend is what the build needs from the engine it acts on.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service builds images on a Backend.

func New

func New(backend Backend) *Service

New creates a Service acting on the given Backend.

func (*Service) Build

func (s *Service) Build(ctx context.Context, project *types.Project, options api.BuildOptions, localImages map[string]api.ImageSummary) (map[string]string, error)

Build builds the services of the project that have something to build, and returns the digest of each image built by image name. Services whose image is already in localImages are skipped, unless their pull policy is "build".

Jump to

Keyboard shortcuts

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