Help us shape the future of Go! Take the 2026 Go Developer Survey

buildkit

package
v1.27.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MPL-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(ctx context.Context, client *buildkit.Client, req BuildRequest) error

func BuildRemote

func BuildRemote(ctx context.Context, opts BuildRemoteOptions) (*config.BuildInfo, error)

func NewDockerClient

func NewDockerClient(ctx context.Context, dockerClient DockerClient) (*client.Client, error)

func NewPrinter

func NewPrinter(ctx context.Context, out io.Writer) (progresswriter.Writer, error)

func ParseBuildSecrets added in v1.10.0

func ParseBuildSecrets(entries []string) (map[string][]byte, error)

func ParseCacheEntry

func ParseCacheEntry(in []string) ([]client.CacheOptionsEntry, error)

func RecordSkipped

func RecordSkipped(ctx context.Context, key, reason string)

RecordSkipped records a build step that was not needed, with the reason.

func SplitBuildSecret added in v1.10.0

func SplitBuildSecret(index int, entry string) (name, value string, err error)

SplitBuildSecret parses one "NAME=VALUE" build-secret entry. The error never echoes entry, which may hold the secret value (e.g. "=value").

Types

type BuildRemoteOptions

type BuildRemoteOptions struct {
	PrebuildHash         string
	ParsedConfig         *config.SubstitutedConfig
	ExtendedBuildInfo    *feature.ExtendedBuildInfo
	DockerfilePath       string
	DockerfileContent    string
	LocalWorkspaceFolder string
	Options              provider.BuildOptions
	TargetArch           string
}

type BuildRequest

type BuildRequest struct {
	Writer   io.Writer
	Platform string
	Options  *build.BuildOptions
}

BuildRequest describes one image build through BuildKit.

type DockerClient

type DockerClient interface {
	DialHijack(ctx context.Context, url, proto string, meta map[string][]string) (net.Conn, error)
}

type Step

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

Step records one build step as an invocation in the run found in the context. A nil Step does nothing, so callers need no recorder checks.

func StartStep

func StartStep(ctx context.Context, key string, buildSecrets ...string) *Step

StartStep marks a build step running. It returns nil when no run is being recorded.

func (*Step) Finish

func (s *Step) Finish(ctx context.Context, err error)

Finish flushes every writer, then records the terminal state for err.

func (*Step) Tee

func (s *Step) Tee(dst io.Writer, stream workspacelogs.Stream) io.Writer

Tee returns a writer that records redacted output of the stream before forwarding to dst. The recorder comes first so the text is kept even when dst filters or fails. Without a step it returns dst unchanged.

Jump to

Keyboard shortcuts

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