package build
import "github.com/docker/buildx/build"
Index ¶
- Constants
- Variables
- func Build(ctx context.Context, nodes []builder.Node, opts map[string]Options, docker *dockerutil.Client, cfg *confutil.Config, w progress.Writer) (resp map[string]*client.SolveResponse, err error)
- func BuildWithResultHandler(ctx context.Context, nodes []builder.Node, opts map[string]Options, docker *dockerutil.Client, cfg *confutil.Config, w progress.Writer, bh *Handler) (resp map[string]*client.SolveResponse, err error)
- func CreateCaches(entries []*buildflags.CacheOptionsEntry) []client.CacheOptionsEntry
- func CreateExports(entries []*buildflags.ExportEntry) ([]client.ExportEntry, []string, error)
- func CreateSSH(ssh []*buildflags.SSH) (session.Attachable, error)
- func CreateSecrets(secrets []*buildflags.Secret) (session.Attachable, error)
- func Dial(ctx context.Context, nodes []builder.Node, pw progress.Writer, platform *ocispecs.Platform) (net.Conn, error)
- func ReadSourcePolicy() (*spb.Policy, error)
- type CallFunc
- type Container
- func NewContainer(ctx context.Context, resultCtx *ResultHandle, cfg *InvokeConfig) (*Container, error)
- func (c *Container) CanInvoke(ctx context.Context, cfg *InvokeConfig) error
- func (c *Container) Cancel()
- func (c *Container) Exec(ctx context.Context, cfg *InvokeConfig, stdin io.ReadCloser, stdout io.WriteCloser, stderr io.WriteCloser) error
- func (c *Container) IsUnavailable() bool
- func (c *Container) ReadDir(ctx context.Context, req gateway.ReadDirContainerRequest) ([]*types.Stat, error)
- func (c *Container) ReadFile(ctx context.Context, req gateway.ReadContainerRequest) ([]byte, error)
- func (c *Container) StatFile(ctx context.Context, req gateway.StatContainerRequest) (*types.Stat, error)
- type EvaluateFunc
- type Handler
- type Inputs
- type InvokeConfig
- type NamedContext
- type Options
- type ResultHandle
- func NewResultHandle(ctx context.Context, c gateway.Client, ref gateway.Reference, meta map[string][]byte, err error) *ResultHandle
- func (r *ResultHandle) Done()
- func (r *ResultHandle) NewContainer(ctx context.Context, cfg *InvokeConfig) (gateway.Container, error)
- type SuspendOn
- func (s SuspendOn) DebugEnabled(err error) bool
- func (s *SuspendOn) UnmarshalText(text []byte) error
- type SyncMultiReader
Constants ¶
const DockerfileLabel = "com.docker.image.source.entrypoint"
Variables ¶
Functions ¶
func Build ¶
func Build(ctx context.Context, nodes []builder.Node, opts map[string]Options, docker *dockerutil.Client, cfg *confutil.Config, w progress.Writer) (resp map[string]*client.SolveResponse, err error)
func BuildWithResultHandler ¶
func BuildWithResultHandler(ctx context.Context, nodes []builder.Node, opts map[string]Options, docker *dockerutil.Client, cfg *confutil.Config, w progress.Writer, bh *Handler) (resp map[string]*client.SolveResponse, err error)
func CreateCaches ¶
func CreateCaches(entries []*buildflags.CacheOptionsEntry) []client.CacheOptionsEntry
func CreateExports ¶
func CreateExports(entries []*buildflags.ExportEntry) ([]client.ExportEntry, []string, error)
func CreateSSH ¶
func CreateSSH(ssh []*buildflags.SSH) (session.Attachable, error)
func CreateSecrets ¶
func CreateSecrets(secrets []*buildflags.Secret) (session.Attachable, error)
func Dial ¶
func Dial(ctx context.Context, nodes []builder.Node, pw progress.Writer, platform *ocispecs.Platform) (net.Conn, error)
func ReadSourcePolicy ¶
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 Container ¶
type Container struct {
// contains filtered or unexported fields
}
func NewContainer ¶
func NewContainer(ctx context.Context, resultCtx *ResultHandle, cfg *InvokeConfig) (*Container, error)
func (*Container) CanInvoke ¶
func (c *Container) CanInvoke(ctx context.Context, cfg *InvokeConfig) error
func (*Container) Cancel ¶
func (c *Container) Cancel()
func (*Container) Exec ¶
func (c *Container) Exec(ctx context.Context, cfg *InvokeConfig, stdin io.ReadCloser, stdout io.WriteCloser, stderr io.WriteCloser) error
func (*Container) IsUnavailable ¶
func (*Container) ReadDir ¶
func (c *Container) ReadDir(ctx context.Context, req gateway.ReadDirContainerRequest) ([]*types.Stat, error)
func (*Container) ReadFile ¶
func (*Container) StatFile ¶
func (c *Container) StatFile(ctx context.Context, req gateway.StatContainerRequest) (*types.Stat, error)
type EvaluateFunc ¶
type EvaluateFunc func(ctx context.Context, name string, c gateway.Client, res *gateway.Result, opt Options) error
type Handler ¶
type Handler struct {
Evaluate EvaluateFunc
}
type Inputs ¶
type Inputs struct {
ContextPath string
DockerfilePath string
InStream *SyncMultiReader
ContextState *llb.State
DockerfileInline string
NamedContexts map[string]NamedContext
// DockerfileMappingSrc and DockerfileMappingDst are filled in by the builder.
DockerfileMappingSrc string
DockerfileMappingDst string
// contains filtered or unexported fields
}
type InvokeConfig ¶
type InvokeConfig struct {
Entrypoint []string `json:"entrypoint,omitempty"`
Cmd []string `json:"cmd,omitempty"`
NoCmd bool `json:"noCmd,omitempty"`
Env []string `json:"env,omitempty"`
User string `json:"user,omitempty"`
NoUser bool `json:"noUser,omitempty"`
Cwd string `json:"cwd,omitempty"`
NoCwd bool `json:"noCwd,omitempty"`
Tty bool `json:"tty,omitempty"`
Rollback bool `json:"rollback,omitempty"`
Initial bool `json:"initial,omitempty"`
SuspendOn SuspendOn `json:"suspendOn,omitempty"`
}
func (*InvokeConfig) NeedsDebug ¶
func (cfg *InvokeConfig) NeedsDebug(err error) bool
type NamedContext ¶
type Options ¶
type Options struct {
Inputs Inputs
Ref string
Allow []string
Attests map[string]*string
BuildArgs map[string]string
CacheFrom []client.CacheOptionsEntry
CacheTo []client.CacheOptionsEntry
CgroupParent string
Exports []client.ExportEntry
ExportsLocalPathsTemporary []string // should be removed after client.ExportEntry update in buildkit v0.19.0
ExtraHosts []string
Labels map[string]string
NetworkMode string
NoCache bool
NoCacheFilter []string
Platforms []ocispecs.Platform
Pull bool
SecretSpecs buildflags.Secrets
SSHSpecs []*buildflags.SSH
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
Annotations map[exptypes.AnnotationKey]string // Not used during build, annotations are already set in Exports. Just used to check for support with drivers.
Policy []buildflags.PolicyConfig
}
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, c gateway.Client, ref gateway.Reference, meta map[string][]byte, err error) *ResultHandle
NewResultHandle stores a gateway client, gateway reference, and the error from an evaluate call if it is present.
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()
func (*ResultHandle) NewContainer ¶
func (r *ResultHandle) NewContainer(ctx context.Context, cfg *InvokeConfig) (gateway.Container, error)
type SuspendOn ¶
type SuspendOn int
func (SuspendOn) DebugEnabled ¶
func (*SuspendOn) UnmarshalText ¶
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 git.go invoke.go localstate.go opt.go policy_loader.go provenance.go replicatedstream.go result.go url.go utils.go
Directories ¶
| Path | Synopsis |
|---|---|
| build/resolver |
- Version
- v0.33.0 (latest)
- Published
- Mar 31, 2026
- Platform
- linux/amd64
- Imports
- 88 packages
- Last checked
- 1 hour ago –
Tools for package owners.