package driver

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

Index

Variables

var ErrNotConnecting = errors.Errorf("driver not connecting")
var ErrNotRunning = errors.Errorf("driver not running")

Functions

func Boot

func Boot(ctx context.Context, d Driver, pw progress.Writer) (*client.Client, error)

func Register

func Register(f Factory)

Types

type BuildkitConfig

type BuildkitConfig struct {
}

type Driver

type Driver interface {
	Factory() Factory
	Bootstrap(context.Context, progress.Logger) error
	Info(context.Context) (*Info, error)
	Stop(ctx context.Context, force bool) error
	Rm(ctx context.Context, force bool) error
	Client(ctx context.Context) (*client.Client, error)
	Features() map[Feature]bool
}

func GetDriver

func GetDriver(ctx context.Context, name string, f Factory, api dockerclient.APIClient) (Driver, error)

type Factory

type Factory interface {
	Name() string
	Usage() string
	Priority(context.Context, dockerclient.APIClient) int
	New(ctx context.Context, cfg InitConfig) (Driver, error)
	AllowsInstances() bool
}

func GetDefaultFactory

func GetDefaultFactory(ctx context.Context, c dockerclient.APIClient, instanceRequired bool) (Factory, error)

func GetFactory

func GetFactory(name string, instanceRequired bool) Factory

type Feature

type Feature string
const CacheExport Feature = "cache export"
const DockerExporter Feature = "Docker exporter"
const MultiPlatform Feature = "multiple platforms"
const OCIExporter Feature = "OCI exporter"

type Info

type Info struct {
	Status Status
}

type InitConfig

type InitConfig struct {
	// This object needs updates to be generic for different drivers
	Name           string
	DockerAPI      dockerclient.APIClient
	BuildkitConfig BuildkitConfig
	Meta           map[string]interface{}
}

type Status

type Status int
const (
	Inactive Status = iota
	Starting
	Running
	Stopping
	Stopped
)

func (Status) String

func (s Status) String() string

Source Files

driver.go features.go manager.go

Directories

PathSynopsis
driver/docker
driver/docker-container
Version
v0.2.2
Published
May 30, 2019
Platform
js/wasm
Imports
6 packages
Last checked
9 hours ago

Tools for package owners.