buildx

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 7 Imported by: 0 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

Overview

Package buildx drives `docker buildx build` for patchy build: it builds the argv for one image entry and runs it through the same tool-runner seam the scanners use, exporting an OCI layout directory instead of loading into a daemon or pushing — nothing reaches a registry until the scan has passed.

With SOURCE_DATE_EPOCH set the export rewrites layer timestamps, so a rebuild of the same commit yields the same digest and a re-run lands on skipped-current instead of a tag conflict.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Args

func Args(r Request) []string

Args builds the docker argv for r (without the leading "docker").

Types

type Builder

type Builder struct {
	// Runner executes docker (nil: the real PATH).
	Runner scan.ToolRunner
}

Builder runs builds through a tool runner.

func (Builder) Build

func (b Builder) Build(ctx context.Context, r Request) error

Build runs one build, exporting the OCI layout to r.Output.

type Request

type Request struct {
	// Dockerfile and Context are paths (absolute, or relative to the
	// process working directory).
	Dockerfile string
	Context    string
	// Platforms are os/arch[/variant] strings.
	Platforms []string
	// Target optionally names the build stage.
	Target string
	// Args are build args, emitted sorted by key.
	Args map[string]string
	// Secrets are BuildKit secret mounts, emitted sorted by ID. Each names
	// where docker reads the value (an environment variable or a file);
	// the value itself never enters the argv.
	Secrets []Secret
	// Output is the OCI layout directory the build exports to.
	Output string
	// SourceDateEpoch, when set, is passed to buildx and turns on
	// rewrite-timestamp for a reproducible digest.
	SourceDateEpoch string
}

Request is one image build.

type Secret added in v0.12.2

type Secret struct {
	ID  string
	Env string
	Src string
}

Secret is one BuildKit secret (RUN --mount=type=secret,id=<ID>): exactly one of Env (a variable in docker's environment) or Src (a file path) is set.

Jump to

Keyboard shortcuts

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