Documentation ¶
Index ¶
- func Build(ctx context.Context, c *client.Client, s *session.Session, pw progress.Writer, ...) error
- func BuildkitClient(ctx context.Context, addr string) (*client.Client, error)
- func NewRemoteDirectory(ctx context.Context, cln *client.Client, pw progress.Writer, ...) (ast.Directory, error)
- func Solve(ctx context.Context, c *client.Client, s *session.Session, pw progress.Writer, ...) error
- func TreeFromDef(tree treeprint.Tree, def *llb.Definition, opts []SolveOption) error
- func WithEvaluate(info *SolveInfo) error
- type Console
- type ContainerConfig
- type ErrorHandler
- type ImageSpec
- type MultiWriter
- type Params
- type Progress
- type ProgressOption
- type Request
- type SolveCallback
- type SolveInfo
- type SolveOption
- func WithCallback(fn SolveCallback) SolveOption
- func WithDownload(dest string) SolveOption
- func WithDownloadDockerTarball(ref string) SolveOption
- func WithDownloadMoby(ref string) SolveOption
- func WithDownloadOCITarball() SolveOption
- func WithDownloadTarball() SolveOption
- func WithEntitlement(e entitlements.Entitlement) SolveOption
- func WithErrorHandler(errorHandler ErrorHandler) SolveOption
- func WithImageSpec(spec *ImageSpec) SolveOption
- func WithPushImage(ref string) SolveOption
- func WithPushMoby(ref string) SolveOption
- func WithStargz(forceCompression bool) SolveOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildkitClient ¶
BuildkitClient returns a basic buildkit client.
func NewRemoteDirectory ¶
func NewRemoteDirectory(ctx context.Context, cln *client.Client, pw progress.Writer, def *llb.Definition, root string, dgst digest.Digest, solveOpts []SolveOption, sessionOpts []llbutil.SessionOption) (ast.Directory, error)
NewRemoteDirectory returns an ast.Directory representing a directory backed by a BuildKit gateway reference. Since gateway references only live while the build session is running, the build only exits when the ast.Directory is closed.
func TreeFromDef ¶
func TreeFromDef(tree treeprint.Tree, def *llb.Definition, opts []SolveOption) error
func WithEvaluate ¶
Types ¶
type Console ¶
type Console interface { io.ReadWriteCloser // Fd returns its file descriptor Fd() uintptr // Name returns its file name Name() string }
Console is intended to match the `File` interface from package `github.com/containerd/console`.
type ContainerConfig ¶
ContainerConfig is the schema1-compatible configuration of the container that is committed into the image.
type ImageSpec ¶
type ImageSpec struct { specs.Image ContainerConfig ContainerConfig `json:"container_config,omitempty"` // Canonical is the fully qualified reference of the image with name and // digest. Canonical reference.Canonical `json:"-"` }
ImageSpec is HLB's wrapper for the OCI specs image, allowing for backward compatible features with Docker.
type MultiWriter ¶
type MultiWriter struct {
// contains filtered or unexported fields
}
MultiWriter is similar to progress.MultiWriter, but deduplicates writes by vertex.
func NewMultiWriter ¶
func NewMultiWriter(pw progress.Writer) *MultiWriter
func (*MultiWriter) WithPrefix ¶
func (mw *MultiWriter) WithPrefix(pfx string, force bool) progress.Writer
type Params ¶
type Params struct { Def *llb.Definition SolveOpts []SolveOption SessionOpts []llbutil.SessionOption }
type Progress ¶
type Progress interface { MultiWriter() *MultiWriter Wait() error // Sync will ensure that all progress has been written. Sync() error }
func NewProgress ¶
func NewProgress(ctx context.Context, opts ...ProgressOption) (Progress, error)
NewProgress returns a Progress that presents all the progress on multiple solves to the terminal stdout.
type ProgressOption ¶
type ProgressOption func(*progressInfo) error
func WithLogOutputPlain ¶
func WithLogOutputPlain(w io.Writer) ProgressOption
func WithLogOutputTTY ¶
func WithLogOutputTTY(con Console) ProgressOption
type Request ¶
type Request interface { // Solve sends the request and its children to BuildKit. The request passes // down the progress.Writer for them to spawn their own progress writers // for each independent solve. Solve(ctx context.Context, cln *client.Client, mw *MultiWriter, opts ...SolveOption) error Tree(tree treeprint.Tree) error }
Request is a node in the solve request tree produced by the compiler. The solve request tree has peer nodes that should be executed in parallel, and next nodes that should be executed sequentially. These can be intermingled to produce a complex build pipeline.
func NilRequest ¶
func NilRequest() Request
func Sequential ¶
type SolveCallback ¶
type SolveCallback func(ctx context.Context, resp *client.SolveResponse) error
type SolveInfo ¶
type SolveInfo struct { Evaluate bool OutputMoby bool OutputDockerRef string OutputPushImage string OutputLocal string OutputLocalTarball bool OutputLocalOCITarball bool OutputStargz bool OutputForceCompression bool Callbacks []SolveCallback `json:"-"` ImageSpec *ImageSpec ErrorHandler ErrorHandler Entitlements []entitlements.Entitlement }
type SolveOption ¶
func WithCallback ¶
func WithCallback(fn SolveCallback) SolveOption
func WithDownload ¶
func WithDownload(dest string) SolveOption
func WithDownloadDockerTarball ¶
func WithDownloadDockerTarball(ref string) SolveOption
func WithDownloadMoby ¶
func WithDownloadMoby(ref string) SolveOption
func WithDownloadOCITarball ¶
func WithDownloadOCITarball() SolveOption
func WithDownloadTarball ¶
func WithDownloadTarball() SolveOption
func WithEntitlement ¶
func WithEntitlement(e entitlements.Entitlement) SolveOption
func WithErrorHandler ¶
func WithErrorHandler(errorHandler ErrorHandler) SolveOption
func WithImageSpec ¶
func WithImageSpec(spec *ImageSpec) SolveOption
func WithPushImage ¶
func WithPushImage(ref string) SolveOption
func WithPushMoby ¶
func WithPushMoby(ref string) SolveOption
func WithStargz ¶
func WithStargz(forceCompression bool) SolveOption