Backend provides build functionality to the API router
type Backend struct {
// contains filtered or unexported fields
}
func NewBackend(components ImageComponent, builder Builder, buildkit *buildkit.Builder, es *daemonevents.Events) (*Backend, error)
NewBackend creates a new build backend from components
func (b *Backend) Build(ctx context.Context, config backend.BuildConfig) (string, error)
Build builds an image from a Source
func (b *Backend) Cancel(ctx context.Context, id string) error
Cancel cancels the build by ID
func (b *Backend) PruneCache(ctx context.Context, opts types.BuildCachePruneOptions) (*types.BuildCachePruneReport, error)
PruneCache removes all cached build sources
func (b *Backend) RegisterGRPC(s *grpc.Server)
RegisterGRPC registers buildkit controller to the grpc server.
Builder defines interface for running a build
type Builder interface { Build(context.Context, backend.BuildConfig) (*builder.Result, error) }
ImageComponent provides an interface for working with images
type ImageComponent interface { SquashImage(from string, to string) (string, error) TagImage(context.Context, image.ID, reference.Named) error }