Documentation ¶
Index ¶
- Constants
- Variables
- func MarshalConstraints(base, override *Constraints) (*pb.Op, *pb.OpMetadata)
- func Readonly(m *mount)
- func WriteTo(def *Definition, w io.Writer) error
- type CacheMountSharingMode
- type Constraints
- type ConstraintsOpt
- func LocalUniqueID(v string) ConstraintsOpt
- func Platform(p specs.Platform) ConstraintsOpt
- func Require(filters ...string) ConstraintsOpt
- func WithCustomName(name string, a ...interface{}) ConstraintsOpt
- func WithDescription(m map[string]string) ConstraintsOpt
- func WithExportCache() ConstraintsOpt
- func WithoutDefaultExportCache() ConstraintsOpt
- func WithoutExportCache() ConstraintsOpt
- type Definition
- 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(c *Constraints) (digest.Digest, []byte, *pb.OpMetadata, error)
- func (e *ExecOp) Output() Output
- func (e *ExecOp) Validate() error
- type ExecState
- 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 Meta
- type MountInfo
- type MountOption
- type Output
- type ProxyEnv
- type ResolveMode
- type RunOption
- func AddEnv(key, value string) RunOption
- func AddEnvf(key, value string, v ...interface{}) 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 Dir(str string) RunOption
- func Dirf(str string, v ...interface{}) RunOption
- func Network(n pb.NetMode) RunOption
- func ReadonlyRootFS() RunOption
- func Reset(s State) RunOption
- func Shlex(str string) RunOption
- func Shlexf(str string, v ...interface{}) RunOption
- func User(str string) RunOption
- func With(so ...StateOption) RunOption
- func WithProxy(ps ProxyEnv) RunOption
- type SSHInfo
- type SSHOption
- type SecretInfo
- type SecretOption
- 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) Dir(str string) State
- func (s State) Dirf(str string, v ...interface{}) State
- func (s State) Env() []string
- func (s State) GetArgs() []string
- func (s State) GetDir() string
- func (s State) GetEnv(key string) (string, bool)
- func (s State) GetNetwork() pb.NetMode
- func (s State) GetPlatform() *specs.Platform
- func (s State) Marshal(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) SetMarshalDefaults(co ...ConstraintsOpt) State
- func (s State) User(v string) State
- func (s State) Validate() error
- func (s State) Value(k interface{}) interface{}
- func (s State) With(so ...StateOption) State
- func (s State) WithOutput(o Output) State
- func (s State) WithValue(k, v interface{}) State
- type StateOption
- type Vertex
Constants ¶
View Source
const ( NetModeSandbox = pb.NetMode_UNSET NetModeHost = pb.NetMode_HOST NetModeNone = pb.NetMode_NONE )
Variables ¶
View Source
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"}) )
View Source
var IgnoreCache = constraintsOptFunc(func(c *Constraints) { c.Metadata.IgnoreCache = true })
View Source
var MarkImageInternal = imageOptionFunc(func(ii *ImageInfo) {
ii.RecordType = "internal"
})
View Source
var SSHOptional = sshOptionFunc(func(si *SSHInfo) { si.Optional = true })
View Source
var SecretOptional = secretOptionFunc(func(si *SecretInfo) { si.Optional = true })
Functions ¶
func MarshalConstraints ¶
func MarshalConstraints(base, override *Constraints) (*pb.Op, *pb.OpMetadata)
Types ¶
type CacheMountSharingMode ¶
type CacheMountSharingMode int
const ( CacheMountPrivate CacheMountLocked )
type Constraints ¶
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 WithCustomName ¶
func WithCustomName(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 Definition ¶
type Definition struct { Def [][]byte Metadata map[digest.Digest]pb.OpMetadata }
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 ExecOp ¶
type ExecOp struct { MarshalCache // contains filtered or unexported fields }
func (*ExecOp) AddMount ¶
func (e *ExecOp) AddMount(target string, source Output, opt ...MountOption) Output
func (*ExecOp) Marshal ¶
func (e *ExecOp) Marshal(c *Constraints) (digest.Digest, []byte, *pb.OpMetadata, error)
type ExecState ¶
type ExecState struct { State // contains filtered or unexported fields }
type GitOption ¶
type GitOption interface {
SetGitOption(*GitInfo)
}
func KeepGitDir ¶
func KeepGitDir() GitOption
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 gw.ResolveImageConfigOpt) (digest.Digest, []byte, error)
}
ImageMetaResolver can resolve image config metadata from a reference
type ImageOption ¶
type ImageOption interface {
SetImageOption(*ImageInfo)
}
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, error)
func (*MarshalCache) Store ¶
func (mc *MarshalCache) Store(dt []byte, md *pb.OpMetadata, c *Constraints)
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 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 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 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 SourceOp ¶
type SourceOp struct { MarshalCache // contains filtered or unexported fields }
func (*SourceOp) Marshal ¶
func (s *SourceOp) Marshal(constraints *Constraints) (digest.Digest, []byte, *pb.OpMetadata, 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) GetNetwork ¶
func (State) GetPlatform ¶
func (State) Marshal ¶
func (s State) Marshal(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) WithOutput ¶
type StateOption ¶
Click to show internal directories.
Click to hide internal directories.