solver

package
v0.2.36 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2022 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanError

func CleanError(err error) error

A helper to remove noise from buildkit error messages. FIXME: Obviously a cleaner solution would be nice.

func NewDockerSocketProvider

func NewDockerSocketProvider(pctx *plancontext.Context) session.Attachable

func NewSecretsStoreProvider

func NewSecretsStoreProvider(pctx *plancontext.Context) session.Attachable

func ParseAuthHost added in v0.2.0

func ParseAuthHost(host string) (string, error)

Parsing function based on splitReposSearchTerm "github.com/docker/docker/registry"

Types

type BuildkitFS

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

BuildkitFS is a io/fs.FS adapter for Buildkit BuildkitFS implements the ReadFileFS, StatFS and ReadDirFS interfaces.

func NewBuildkitFS

func NewBuildkitFS(ref bkgw.Reference) *BuildkitFS

func (*BuildkitFS) Open

func (f *BuildkitFS) Open(name string) (fs.File, error)

Open is not supported.

func (*BuildkitFS) ReadDir

func (f *BuildkitFS) ReadDir(name string) ([]fs.DirEntry, error)

func (*BuildkitFS) ReadFile

func (f *BuildkitFS) ReadFile(name string) ([]byte, error)

func (*BuildkitFS) Stat

func (f *BuildkitFS) Stat(name string) (fs.FileInfo, error)

type ContainerAlreadyStoppedError added in v0.2.15

type ContainerAlreadyStoppedError struct {
	ID string
}

func (ContainerAlreadyStoppedError) Error added in v0.2.15

type ContainerNotFoundError added in v0.2.9

type ContainerNotFoundError struct {
	ID string
}

func (ContainerNotFoundError) Error added in v0.2.9

func (e ContainerNotFoundError) Error() string

type Opts

type Opts struct {
	Control      *bk.Client
	Gateway      bkgw.Client
	Events       chan *bk.SolveStatus
	Context      *plancontext.Context
	Auth         *RegistryAuthProvider
	NoCache      bool
	CacheImports []bkgw.CacheOptionsEntry
}

type RegistryAuthProvider

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

RegistryAuthProvider is a buildkit provider for registry authentication Adapted from: https://github.com/moby/buildkit/blob/master/session/auth/authprovider/authprovider.go

func NewRegistryAuthProvider

func NewRegistryAuthProvider() *RegistryAuthProvider

func (*RegistryAuthProvider) AddCredentials

func (a *RegistryAuthProvider) AddCredentials(target, username, secret string)

func (*RegistryAuthProvider) Credentials

func (*RegistryAuthProvider) FetchToken

func (*RegistryAuthProvider) GetTokenAuthority

func (*RegistryAuthProvider) Register

func (a *RegistryAuthProvider) Register(server *grpc.Server)

func (*RegistryAuthProvider) VerifyTokenAuthority

type SocketProvider

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

func (*SocketProvider) CheckAgent

func (*SocketProvider) ForwardAgent

func (sp *SocketProvider) ForwardAgent(stream sshforward.SSH_ForwardAgentServer) error

func (*SocketProvider) Register

func (sp *SocketProvider) Register(server *grpc.Server)

type Solver

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

func New

func New(opts Opts) *Solver

func (*Solver) AddCredentials

func (s *Solver) AddCredentials(target, username, secret string)

func (*Solver) ContainerName added in v0.2.24

func (s *Solver) ContainerName(ctrID string) (string, error)

func (*Solver) Export

func (s *Solver) Export(ctx context.Context, st llb.State, img *dockerfile2llb.Image, output bk.ExportEntry, platform specs.Platform) (*bk.SolveResponse, error)

Export will export `st` to `output` FIXME: this is currently implemented as a hack, starting a new Build session within buildkit from the Control API. Ideally the Gateway API should allow to Export directly.

func (*Solver) GetOptions

func (s *Solver) GetOptions() Opts

func (*Solver) Marshal

func (s *Solver) Marshal(ctx context.Context, st llb.State, co ...llb.ConstraintsOpt) (*bkpb.Definition, error)

func (*Solver) NoCache

func (s *Solver) NoCache() bool

func (*Solver) References added in v0.2.5

func (s *Solver) References() []bkgw.Reference

func (*Solver) ResolveImageConfig

func (s *Solver) ResolveImageConfig(ctx context.Context, ref string, opts llb.ResolveImageConfigOpt) (dockerfile2llb.Image, digest.Digest, error)

func (*Solver) SessionID

func (s *Solver) SessionID() string

func (*Solver) SignalContainer added in v0.2.15

func (s *Solver) SignalContainer(ctx context.Context, ctrID string, sig syscall.Signal) error

func (*Solver) Solve

func (s *Solver) Solve(ctx context.Context, st llb.State, platform specs.Platform) (bkgw.Reference, error)

Solve will block until the state is solved and returns a Reference. It takes a platform as argument which correspond to the targeted platform.

func (*Solver) SolveRequest

func (s *Solver) SolveRequest(ctx context.Context, req bkgw.SolveRequest) (*bkgw.Result, error)

Solve will block until the state is solved and returns a Reference.

func (*Solver) StartContainer added in v0.2.9

func (s *Solver) StartContainer(ctx context.Context, req StartContainerRequest) (string, error)

func (*Solver) Stop

func (s *Solver) Stop(ctx context.Context)

func (*Solver) StopContainer added in v0.2.9

func (s *Solver) StopContainer(ctx context.Context, ctrID string, timeout time.Duration) (uint8, error)

type StartContainerRequest added in v0.2.9

type StartContainerRequest struct {
	Name      string
	Container client.NewContainerRequest
	Proc      client.StartRequest
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL