package build

import "github.com/docker/buildx/build"

Index

Constants

const DockerfileLabel = "com.docker.image.source.entrypoint"

Functions

func Build

func Build(ctx context.Context, nodes []builder.Node, opt map[string]Options, docker *dockerutil.Client, configDir string, w progress.Writer) (resp map[string]*client.SolveResponse, err error)

func BuildWithResultHandler

func BuildWithResultHandler(ctx context.Context, nodes []builder.Node, opt map[string]Options, docker *dockerutil.Client, configDir string, w progress.Writer, resultHandleFunc func(driverIndex int, rCtx *ResultHandle)) (resp map[string]*client.SolveResponse, err error)

func Dial

func Dial(ctx context.Context, nodes []builder.Node, pw progress.Writer, platform *v1.Platform) (net.Conn, error)

func IsRemoteURL

func IsRemoteURL(c string) bool

func ReadSourcePolicy

func ReadSourcePolicy() (*spb.Policy, error)

ReadSourcePolicy reads a source policy from a file. The file path is taken from EXPERIMENTAL_BUILDKIT_SOURCE_POLICY env var. if the env var is not set, this `returns nil, nil`

Types

type CallFunc

type CallFunc struct {
	Name         string
	Format       string
	IgnoreStatus bool
}

type Container

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

func NewContainer

func NewContainer(ctx context.Context, resultCtx *ResultHandle, cfg *controllerapi.InvokeConfig) (*Container, error)

func (*Container) Cancel

func (c *Container) Cancel()

func (*Container) Exec

func (c *Container) Exec(ctx context.Context, cfg *controllerapi.InvokeConfig, stdin io.ReadCloser, stdout io.WriteCloser, stderr io.WriteCloser) error

func (*Container) IsUnavailable

func (c *Container) IsUnavailable() bool

type Inputs

type Inputs struct {
	ContextPath      string
	DockerfilePath   string
	InStream         *SyncMultiReader
	ContextState     *llb.State
	DockerfileInline string
	NamedContexts    map[string]NamedContext
}

type NamedContext

type NamedContext struct {
	Path  string
	State *llb.State
}

type Options

type Options struct {
	Inputs Inputs

	Ref           string
	Allow         []entitlements.Entitlement
	Attests       map[string]*string
	BuildArgs     map[string]string
	CacheFrom     []client.CacheOptionsEntry
	CacheTo       []client.CacheOptionsEntry
	CgroupParent  string
	Exports       []client.ExportEntry
	ExtraHosts    []string
	Labels        map[string]string
	NetworkMode   string
	NoCache       bool
	NoCacheFilter []string
	Platforms     []specs.Platform
	Pull          bool
	ShmSize       opts.MemBytes
	Tags          []string
	Target        string
	Ulimits       *opts.UlimitOpt

	Session                []session.Attachable
	Linked                 bool // Linked marks this target as exclusively linked (not requested by the user).
	CallFunc               *CallFunc
	ProvenanceResponseMode confutil.MetadataProvenanceMode
	SourcePolicy           *spb.Policy
	GroupRef               string
}

type ResultHandle

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

ResultHandle is a build result with the client that built it.

func NewResultHandle

func NewResultHandle(ctx context.Context, cc *client.Client, opt client.SolveOpt, product string, buildFunc gateway.BuildFunc, ch chan *client.SolveStatus) (*ResultHandle, *client.SolveResponse, error)

NewResultHandle makes a call to client.Build, additionally returning a opaque ResultHandle alongside the standard response and error.

This ResultHandle can be used to execute additional build steps in the same context as the build occurred, which can allow easy debugging of build failures and successes.

If the returned ResultHandle is not nil, the caller must call Done() on it.

func (*ResultHandle) Done

func (r *ResultHandle) Done()

type SyncMultiReader

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

func NewSyncMultiReader

func NewSyncMultiReader(source io.Reader) *SyncMultiReader

func (*SyncMultiReader) NewReadCloser

func (mr *SyncMultiReader) NewReadCloser() io.ReadCloser

func (*SyncMultiReader) Peek

func (mr *SyncMultiReader) Peek(n int) ([]byte, error)

func (*SyncMultiReader) Reset

func (mr *SyncMultiReader) Reset(dt []byte)

Source Files

build.go dial.go driver.go git.go invoke.go localstate.go opt.go provenance.go replicatedstream.go result.go url.go utils.go

Version
v0.17.0-rc2
Published
Sep 9, 2024
Platform
js/wasm
Imports
72 packages
Last checked
13 hours ago

Tools for package owners.