Documentation ¶
Index ¶
- Constants
- Variables
- func ForceNoOutput(m *mount)
- func MarshalConstraints(base, override *Constraints) (*pb.Op, *pb.OpMetadata)
- func Readonly(m *mount)
- func WriteTo(def *Definition, w io.Writer) error
- type CacheMountSharingMode
- type ChownOpt
- type ChownOption
- type Constraints
- type ConstraintsOpt
- func LocalUniqueID(v string) ConstraintsOpt
- func Platform(p specs.Platform) ConstraintsOpt
- func Require(filters ...string) ConstraintsOpt
- func WithCaps(caps apicaps.CapSet) ConstraintsOpt
- func WithCustomName(name string) ConstraintsOpt
- func WithCustomNamef(name string, a ...interface{}) ConstraintsOpt
- func WithDescription(m map[string]string) ConstraintsOpt
- func WithExportCache() ConstraintsOpt
- func WithoutDefaultExportCache() ConstraintsOpt
- func WithoutExportCache() ConstraintsOpt
- type CopyInfo
- type CopyInput
- type CopyOption
- type CreatedTime
- type Definition
- type DefinitionOp
- func (d *DefinitionOp) Inputs() []Output
- func (d *DefinitionOp) Marshal(ctx context.Context, c *Constraints) (digest.Digest, []byte, *pb.OpMetadata, []*SourceLocation, error)
- func (d *DefinitionOp) Output() Output
- func (d *DefinitionOp) ToInput(ctx context.Context, c *Constraints) (*pb.Input, error)
- func (d *DefinitionOp) Validate(context.Context) error
- func (d *DefinitionOp) Vertex(context.Context) Vertex
- type EnvList
- type ExecInfo
- type ExecOp
- func (e *ExecOp) AddMount(target string, source Output, opt ...MountOption) Output
- func (e *ExecOp) GetMount(target string) Output
- func (e *ExecOp) Inputs() (inputs []Output)
- func (e *ExecOp) Marshal(ctx context.Context, c *Constraints) (digest.Digest, []byte, *pb.OpMetadata, []*SourceLocation, error)
- func (e *ExecOp) Output() Output
- func (e *ExecOp) Validate(ctx context.Context) error
- type ExecState
- type FileAction
- func (fa *FileAction) Copy(input CopyInput, src, dest string, opt ...CopyOption) *FileAction
- func (fa *FileAction) Mkdir(p string, m os.FileMode, opt ...MkdirOption) *FileAction
- func (fa *FileAction) Mkfile(p string, m os.FileMode, dt []byte, opt ...MkfileOption) *FileAction
- func (fa *FileAction) Rm(p string, opt ...RmOption) *FileAction
- func (fa *FileAction) WithState(s State) CopyInput
- type FileOp
- type GitInfo
- type GitOption
- type HTTPInfo
- type HTTPOption
- type HostIP
- type ImageInfo
- type ImageMetaResolver
- type ImageOption
- type KeyValue
- type LocalInfo
- type LocalOption
- type MarshalCache
- type MkdirInfo
- type MkdirOption
- type MkfileInfo
- type MkfileOption
- type MountInfo
- type MountOption
- type Output
- type ProxyEnv
- type ResolveImageConfigOpt
- type ResolveMode
- type RmInfo
- type RmOption
- type RunOption
- func AddExtraHost(host string, ip net.IP) RunOption
- func AddMount(dest string, mountState State, opts ...MountOption) RunOption
- func AddSSHSocket(opts ...SSHOption) RunOption
- func AddSecret(dest string, opts ...SecretOption) RunOption
- func Args(a []string) RunOption
- func ReadonlyRootFS() RunOption
- func Shlex(str string) RunOption
- func Shlexf(str string, v ...interface{}) RunOption
- func With(so ...StateOption) RunOption
- func WithProxy(ps ProxyEnv) RunOption
- type SSHInfo
- type SSHOption
- type SecretInfo
- type SecretOption
- type SourceLocation
- type SourceMap
- type SourceOp
- type State
- func (s State) AddEnv(key, value string) State
- func (s State) AddEnvf(key, value string, v ...interface{}) State
- func (s State) AddExtraHost(host string, ip net.IP) State
- func (s State) Async(f func(context.Context, State) (State, error)) State
- func (s State) Dir(str string) State
- func (s State) Dirf(str string, v ...interface{}) State
- func (s State) Env(ctx context.Context) ([]string, error)
- func (s State) File(a *FileAction, opts ...ConstraintsOpt) State
- func (s State) GetArgs(ctx context.Context) ([]string, error)
- func (s State) GetDir(ctx context.Context) (string, error)
- func (s State) GetEnv(ctx context.Context, key string) (string, bool, error)
- func (s State) GetHostname(ctx context.Context) (string, error)
- func (s State) GetNetwork(ctx context.Context) (pb.NetMode, error)
- func (s State) GetPlatform(ctx context.Context) (*specs.Platform, error)
- func (s State) GetSecurity(ctx context.Context) (pb.SecurityMode, error)
- func (s State) Hostname(v string) State
- func (s State) Marshal(ctx context.Context, co ...ConstraintsOpt) (*Definition, error)
- func (s State) Network(n pb.NetMode) State
- func (s State) Output() Output
- func (s State) Platform(p specs.Platform) State
- func (s State) Reset(s2 State) State
- func (s State) Run(ro ...RunOption) ExecState
- func (s State) Security(n pb.SecurityMode) State
- func (s State) SetMarshalDefaults(co ...ConstraintsOpt) State
- func (s State) User(v string) State
- func (s State) Validate(ctx context.Context) error
- func (s State) Value(ctx context.Context, k interface{}) (interface{}, error)
- func (s State) With(so ...StateOption) State
- func (s State) WithImageConfig(c []byte) (State, error)
- func (s State) WithOutput(o Output) State
- func (s State) WithValue(k, v interface{}) State
- type StateOption
- func AddEnv(key, value string) StateOption
- func AddEnvf(key, value string, v ...interface{}) StateOption
- func Dir(str string) StateOption
- func Dirf(str string, v ...interface{}) StateOption
- func Hostname(str string) StateOption
- func Network(v pb.NetMode) StateOption
- func Reset(other State) StateOption
- func Security(v pb.SecurityMode) StateOption
- func User(str string) StateOption
- type UserOpt
- type Vertex
Constants ¶
const ( NetModeSandbox = pb.NetMode_UNSET NetModeHost = pb.NetMode_HOST NetModeNone = pb.NetMode_NONE )
const ( SecurityModeInsecure = pb.SecurityMode_INSECURE SecurityModeSandbox = pb.SecurityMode_SANDBOX )
Variables ¶
var ( LinuxAmd64 = Platform(specs.Platform{OS: "linux", Architecture: "amd64"}) LinuxArmhf = Platform(specs.Platform{OS: "linux", Architecture: "arm", Variant: "v7"}) LinuxArm = LinuxArmhf LinuxArmel = Platform(specs.Platform{OS: "linux", Architecture: "arm", Variant: "v6"}) LinuxArm64 = Platform(specs.Platform{OS: "linux", Architecture: "arm64"}) LinuxS390x = Platform(specs.Platform{OS: "linux", Architecture: "s390x"}) LinuxPpc64le = Platform(specs.Platform{OS: "linux", Architecture: "ppc64le"}) Darwin = Platform(specs.Platform{OS: "darwin", Architecture: "amd64"}) Windows = Platform(specs.Platform{OS: "windows", Architecture: "amd64"}) )
var IgnoreCache = constraintsOptFunc(func(c *Constraints) { c.Metadata.IgnoreCache = true })
var MarkImageInternal = imageOptionFunc(func(ii *ImageInfo) {
ii.RecordType = "internal"
})
var SSHOptional = sshOptionFunc(func(si *SSHInfo) { si.Optional = true })
var SecretOptional = secretOptionFunc(func(si *SecretInfo) { si.Optional = true })
Functions ¶
func ForceNoOutput ¶ added in v0.5.0
func ForceNoOutput(m *mount)
func MarshalConstraints ¶
func MarshalConstraints(base, override *Constraints) (*pb.Op, *pb.OpMetadata)
Types ¶
type CacheMountSharingMode ¶
type CacheMountSharingMode int
const ( CacheMountPrivate CacheMountLocked )
type ChownOpt ¶ added in v0.5.0
func (ChownOpt) SetCopyOption ¶ added in v0.5.0
func (ChownOpt) SetMkdirOption ¶ added in v0.5.0
func (ChownOpt) SetMkfileOption ¶ added in v0.5.0
func (co ChownOpt) SetMkfileOption(mi *MkfileInfo)
type ChownOption ¶ added in v0.5.0
type ChownOption interface { MkdirOption MkfileOption CopyOption }
func WithUIDGID ¶ added in v0.5.0
func WithUIDGID(uid, gid int) ChownOption
func WithUser ¶ added in v0.5.0
func WithUser(name string) ChownOption
type Constraints ¶
type Constraints struct { Platform *specs.Platform WorkerConstraints []string Metadata pb.OpMetadata LocalUniqueID string Caps *apicaps.CapSet SourceLocations []*SourceLocation }
type ConstraintsOpt ¶
type ConstraintsOpt interface { SetConstraintsOption(*Constraints) RunOption LocalOption HTTPOption ImageOption GitOption }
func LocalUniqueID ¶
func LocalUniqueID(v string) ConstraintsOpt
func Platform ¶
func Platform(p specs.Platform) ConstraintsOpt
func Require ¶
func Require(filters ...string) ConstraintsOpt
func WithCaps ¶
func WithCaps(caps apicaps.CapSet) ConstraintsOpt
WithCaps exposes supported LLB caps to the marshaler
func WithCustomName ¶
func WithCustomName(name string) ConstraintsOpt
func WithCustomNamef ¶ added in v0.4.0
func WithCustomNamef(name string, a ...interface{}) ConstraintsOpt
func WithDescription ¶
func WithDescription(m map[string]string) ConstraintsOpt
func WithExportCache ¶
func WithExportCache() ConstraintsOpt
WithExportCache forces results for this vertex to be exported with the cache
func WithoutDefaultExportCache ¶
func WithoutDefaultExportCache() ConstraintsOpt
WithoutDefaultExportCache resets the cache export for the vertex to use the default defined by the build configuration.
func WithoutExportCache ¶
func WithoutExportCache() ConstraintsOpt
WithoutExportCache sets results for this vertex to be not exported with the cache
type CopyInfo ¶ added in v0.5.0
type CopyInfo struct { Mode *os.FileMode FollowSymlinks bool CopyDirContentsOnly bool AttemptUnpack bool CreateDestPath bool AllowWildcard bool AllowEmptyWildcard bool ChownOpt *ChownOpt CreatedTime *time.Time }
func (*CopyInfo) SetCopyOption ¶ added in v0.5.0
type CopyInput ¶ added in v0.5.0
type CopyInput interface {
// contains filtered or unexported methods
}
CopyInput is either llb.State or *FileActionWithState
type CopyOption ¶ added in v0.5.0
type CopyOption interface {
SetCopyOption(*CopyInfo)
}
type CreatedTime ¶ added in v0.5.0
func WithCreatedTime ¶ added in v0.5.0
func WithCreatedTime(t time.Time) CreatedTime
func (CreatedTime) SetCopyOption ¶ added in v0.5.0
func (c CreatedTime) SetCopyOption(mi *CopyInfo)
func (CreatedTime) SetMkdirOption ¶ added in v0.5.0
func (c CreatedTime) SetMkdirOption(mi *MkdirInfo)
func (CreatedTime) SetMkfileOption ¶ added in v0.5.0
func (c CreatedTime) SetMkfileOption(mi *MkfileInfo)
type Definition ¶
Definition is the LLB definition structure with per-vertex metadata entries Corresponds to the Definition structure defined in solver/pb.Definition.
func (*Definition) FromPB ¶
func (def *Definition) FromPB(x *pb.Definition)
func (*Definition) ToPB ¶
func (def *Definition) ToPB() *pb.Definition
type DefinitionOp ¶ added in v0.7.0
type DefinitionOp struct { MarshalCache // contains filtered or unexported fields }
DefinitionOp implements llb.Vertex using a marshalled definition.
For example, after marshalling a LLB state and sending over the wire, the LLB state can be reconstructed from the definition.
func NewDefinitionOp ¶ added in v0.7.0
func NewDefinitionOp(def *pb.Definition) (*DefinitionOp, error)
NewDefinitionOp returns a new operation from a marshalled definition.
func (*DefinitionOp) Inputs ¶ added in v0.7.0
func (d *DefinitionOp) Inputs() []Output
func (*DefinitionOp) Marshal ¶ added in v0.7.0
func (d *DefinitionOp) Marshal(ctx context.Context, c *Constraints) (digest.Digest, []byte, *pb.OpMetadata, []*SourceLocation, error)
func (*DefinitionOp) Output ¶ added in v0.7.0
func (d *DefinitionOp) Output() Output
func (*DefinitionOp) ToInput ¶ added in v0.7.0
func (d *DefinitionOp) ToInput(ctx context.Context, c *Constraints) (*pb.Input, error)
type ExecOp ¶
type ExecOp struct { MarshalCache // contains filtered or unexported fields }
func NewExecOp ¶
func NewExecOp(base State, proxyEnv *ProxyEnv, readOnly bool, c Constraints) *ExecOp
func (*ExecOp) AddMount ¶
func (e *ExecOp) AddMount(target string, source Output, opt ...MountOption) Output
func (*ExecOp) Marshal ¶
func (e *ExecOp) Marshal(ctx context.Context, c *Constraints) (digest.Digest, []byte, *pb.OpMetadata, []*SourceLocation, error)
type ExecState ¶
type ExecState struct { State // contains filtered or unexported fields }
type FileAction ¶ added in v0.5.0
type FileAction struct {
// contains filtered or unexported fields
}
func Copy ¶ added in v0.5.0
func Copy(input CopyInput, src, dest string, opts ...CopyOption) *FileAction
func Mkdir ¶ added in v0.5.0
func Mkdir(p string, m os.FileMode, opt ...MkdirOption) *FileAction
func Mkfile ¶ added in v0.5.0
func Mkfile(p string, m os.FileMode, dt []byte, opts ...MkfileOption) *FileAction
func Rm ¶ added in v0.5.0
func Rm(p string, opts ...RmOption) *FileAction
func (*FileAction) Copy ¶ added in v0.5.0
func (fa *FileAction) Copy(input CopyInput, src, dest string, opt ...CopyOption) *FileAction
func (*FileAction) Mkdir ¶ added in v0.5.0
func (fa *FileAction) Mkdir(p string, m os.FileMode, opt ...MkdirOption) *FileAction
func (*FileAction) Mkfile ¶ added in v0.5.0
func (fa *FileAction) Mkfile(p string, m os.FileMode, dt []byte, opt ...MkfileOption) *FileAction
func (*FileAction) Rm ¶ added in v0.5.0
func (fa *FileAction) Rm(p string, opt ...RmOption) *FileAction
func (*FileAction) WithState ¶ added in v0.5.0
func (fa *FileAction) WithState(s State) CopyInput
type FileOp ¶ added in v0.5.0
type FileOp struct { MarshalCache // contains filtered or unexported fields }
func NewFileOp ¶ added in v0.5.0
func NewFileOp(s State, action *FileAction, c Constraints) *FileOp
func (*FileOp) Marshal ¶ added in v0.5.0
func (f *FileOp) Marshal(ctx context.Context, c *Constraints) (digest.Digest, []byte, *pb.OpMetadata, []*SourceLocation, error)
type GitOption ¶
type GitOption interface {
SetGitOption(*GitInfo)
}
func AuthHeaderSecret ¶ added in v0.8.0
func AuthTokenSecret ¶ added in v0.8.0
func KeepGitDir ¶
func KeepGitDir() GitOption
func KnownSSHHosts ¶ added in v0.8.0
func MountSSHSock ¶ added in v0.8.0
type HTTPOption ¶
type HTTPOption interface {
SetHTTPOption(*HTTPInfo)
}
func Checksum ¶
func Checksum(dgst digest.Digest) HTTPOption
func Chmod ¶
func Chmod(perm os.FileMode) HTTPOption
func Chown ¶
func Chown(uid, gid int) HTTPOption
func Filename ¶
func Filename(name string) HTTPOption
type ImageInfo ¶
type ImageInfo struct { RecordType string // contains filtered or unexported fields }
type ImageMetaResolver ¶
type ImageMetaResolver interface {
ResolveImageConfig(ctx context.Context, ref string, opt ResolveImageConfigOpt) (digest.Digest, []byte, error)
}
ImageMetaResolver can resolve image config metadata from a reference
type ImageOption ¶
type ImageOption interface {
SetImageOption(*ImageInfo)
}
func ResolveDigest ¶ added in v0.8.0
func ResolveDigest(v bool) ImageOption
ResolveDigest uses the meta resolver to update the ref of image with full digest before marshaling. This makes image ref immutable and is recommended if you want to make sure meta resolver data matches the image used during the build.
func WithMetaResolver ¶
func WithMetaResolver(mr ImageMetaResolver) ImageOption
WithMetaResolver adds a metadata resolver to an image
type LocalOption ¶
type LocalOption interface {
SetLocalOption(*LocalInfo)
}
func ExcludePatterns ¶
func ExcludePatterns(p []string) LocalOption
func FollowPaths ¶
func FollowPaths(p []string) LocalOption
func IncludePatterns ¶
func IncludePatterns(p []string) LocalOption
func SessionID ¶
func SessionID(id string) LocalOption
func SharedKeyHint ¶
func SharedKeyHint(h string) LocalOption
type MarshalCache ¶
type MarshalCache struct {
// contains filtered or unexported fields
}
func (*MarshalCache) Cached ¶
func (mc *MarshalCache) Cached(c *Constraints) bool
func (*MarshalCache) Load ¶
func (mc *MarshalCache) Load() (digest.Digest, []byte, *pb.OpMetadata, []*SourceLocation, error)
func (*MarshalCache) Store ¶
func (mc *MarshalCache) Store(dt []byte, md *pb.OpMetadata, srcs []*SourceLocation, c *Constraints)
type MkdirInfo ¶ added in v0.5.0
func (*MkdirInfo) SetMkdirOption ¶ added in v0.5.0
type MkdirOption ¶ added in v0.5.0
type MkdirOption interface {
SetMkdirOption(*MkdirInfo)
}
func WithParents ¶ added in v0.5.0
func WithParents(b bool) MkdirOption
type MkfileInfo ¶ added in v0.5.0
func (*MkfileInfo) SetMkfileOption ¶ added in v0.5.0
func (mi *MkfileInfo) SetMkfileOption(mi2 *MkfileInfo)
type MkfileOption ¶ added in v0.5.0
type MkfileOption interface {
SetMkfileOption(*MkfileInfo)
}
type MountInfo ¶
type MountInfo struct { Target string Source Output Opts []MountOption }
type MountOption ¶
type MountOption func(*mount)
func AsPersistentCacheDir ¶
func AsPersistentCacheDir(id string, sharing CacheMountSharingMode) MountOption
func SourcePath ¶
func SourcePath(src string) MountOption
func Tmpfs ¶
func Tmpfs() MountOption
type ResolveImageConfigOpt ¶ added in v0.7.0
type ResolveMode ¶
type ResolveMode int
const ( ResolveModeDefault ResolveMode = iota ResolveModeForcePull ResolveModePreferLocal )
func (ResolveMode) SetImageOption ¶
func (r ResolveMode) SetImageOption(ii *ImageInfo)
func (ResolveMode) String ¶
func (r ResolveMode) String() string
type RmInfo ¶ added in v0.5.0
func (*RmInfo) SetRmOption ¶ added in v0.5.0
type RmOption ¶ added in v0.5.0
type RmOption interface {
SetRmOption(*RmInfo)
}
func WithAllowNotFound ¶ added in v0.5.0
func WithAllowWildcard ¶ added in v0.5.0
type RunOption ¶
type RunOption interface {
SetRunOption(es *ExecInfo)
}
func AddSSHSocket ¶
func AddSecret ¶
func AddSecret(dest string, opts ...SecretOption) RunOption
func ReadonlyRootFS ¶
func ReadonlyRootFS() RunOption
func With ¶
func With(so ...StateOption) RunOption
type SSHOption ¶
type SSHOption interface {
SetSSHOption(*SSHInfo)
}
func SSHSocketOpt ¶
func SSHSocketTarget ¶
type SecretInfo ¶
type SecretOption ¶
type SecretOption interface {
SetSecretOption(*SecretInfo)
}
func SecretFileOpt ¶
func SecretFileOpt(uid, gid, mode int) SecretOption
func SecretID ¶
func SecretID(id string) SecretOption
type SourceLocation ¶ added in v0.8.0
type SourceMap ¶ added in v0.8.0
type SourceMap struct { State *State Definition *Definition Filename string Data []byte }
func NewSourceMap ¶ added in v0.8.0
type SourceOp ¶
type SourceOp struct { MarshalCache // contains filtered or unexported fields }
func (*SourceOp) Marshal ¶
func (s *SourceOp) Marshal(ctx context.Context, constraints *Constraints) (digest.Digest, []byte, *pb.OpMetadata, []*SourceLocation, error)
type State ¶
type State struct {
// contains filtered or unexported fields
}
func HTTP ¶
func HTTP(url string, opts ...HTTPOption) State
func Image ¶
func Image(ref string, opts ...ImageOption) State
func Local ¶
func Local(name string, opts ...LocalOption) State
func (State) File ¶ added in v0.5.0
func (s State) File(a *FileAction, opts ...ConstraintsOpt) State
func (State) GetHostname ¶ added in v0.8.0
func (State) GetSecurity ¶ added in v0.5.0
func (State) Marshal ¶
func (s State) Marshal(ctx context.Context, co ...ConstraintsOpt) (*Definition, error)
func (State) SetMarshalDefaults ¶
func (s State) SetMarshalDefaults(co ...ConstraintsOpt) State
func (State) With ¶
func (s State) With(so ...StateOption) State
func (State) WithImageConfig ¶ added in v0.3.2
func (State) WithOutput ¶
type StateOption ¶
func AddEnv ¶
func AddEnv(key, value string) StateOption
func AddEnvf ¶
func AddEnvf(key, value string, v ...interface{}) StateOption
func Dir ¶
func Dir(str string) StateOption
func Dirf ¶
func Dirf(str string, v ...interface{}) StateOption
func Hostname ¶ added in v0.8.0
func Hostname(str string) StateOption
func Network ¶
func Network(v pb.NetMode) StateOption
func Reset ¶
func Reset(other State) StateOption
func Security ¶ added in v0.5.0
func Security(v pb.SecurityMode) StateOption
func User ¶
func User(str string) StateOption
func (StateOption) SetRunOption ¶ added in v0.8.0
func (fn StateOption) SetRunOption(ei *ExecInfo)