package llb
import "github.com/moby/buildkit/client/llb"
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
- func (co ChownOpt) SetCopyOption(mi *CopyInfo)
- func (co ChownOpt) SetMkdirOption(mi *MkdirInfo)
- func (co ChownOpt) SetMkfileOption(mi *MkfileInfo)
- type ChownOption
- type Constraints
- type ConstraintsOpt
- func LocalUniqueID(v string) ConstraintsOpt
- func Platform(p ocispecs.Platform) ConstraintsOpt
- func ProgressGroup(id, name string, weak bool) 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
- func WithCreatedTime(t time.Time) CreatedTime
- func (c CreatedTime) SetCopyOption(mi *CopyInfo)
- func (c CreatedTime) SetMkdirOption(mi *MkdirInfo)
- func (c CreatedTime) SetMkfileOption(mi *MkfileInfo)
- type Definition
- func ReadFrom(r io.Reader) (*Definition, error)
- func (def *Definition) FromPB(x *pb.Definition)
- func (def *Definition) Head() (digest.Digest, error)
- func (def *Definition) ToPB() *pb.Definition
- type DefinitionOp
- func NewDefinitionOp(def *pb.Definition) (*DefinitionOp, error)
- 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, *Constraints) error
- func (d *DefinitionOp) Vertex(context.Context, *Constraints) Vertex
- type DiffOp
- func NewDiff(lower, upper State, c Constraints) *DiffOp
- func (m *DiffOp) Inputs() (out []Output)
- func (m *DiffOp) Marshal(ctx context.Context, constraints *Constraints) (digest.Digest, []byte, *pb.OpMetadata, []*SourceLocation, error)
- func (m *DiffOp) Output() Output
- func (m *DiffOp) Validate(ctx context.Context, constraints *Constraints) error
- type DiffType
- type DifferInfo
- type EnvList
- func (e EnvList) AddOrReplace(k, v string) EnvList
- func (e EnvList) Delete(k string) EnvList
- func (e EnvList) Get(k string) (string, bool)
- func (e EnvList) Index(k string) (int, bool)
- func (e EnvList) SetDefault(k, v string) EnvList
- func (e EnvList) ToArray() []string
- type ExecInfo
- type ExecOp
- func NewExecOp(base State, proxyEnv *ProxyEnv, readOnly bool, c Constraints) *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, c *Constraints) error
- type ExecState
- func (e ExecState) AddMount(target string, source State, opt ...MountOption) State
- func (e ExecState) GetMount(target string) State
- func (e ExecState) Root() State
- type FileAction
- func Copy(input CopyInput, src, dest string, opts ...CopyOption) *FileAction
- func Mkdir(p string, m os.FileMode, opt ...MkdirOption) *FileAction
- func Mkfile(p string, m os.FileMode, dt []byte, opts ...MkfileOption) *FileAction
- func Rm(p string, opts ...RmOption) *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
- func NewFileOp(s State, action *FileAction, c Constraints) *FileOp
- func (f *FileOp) Inputs() (inputs []Output)
- func (f *FileOp) Marshal(ctx context.Context, c *Constraints) (digest.Digest, []byte, *pb.OpMetadata, []*SourceLocation, error)
- func (f *FileOp) Output() Output
- func (f *FileOp) Validate(context.Context, *Constraints) error
- type GitInfo
- type GitOption
- func AuthHeaderSecret(v string) GitOption
- func AuthTokenSecret(v string) GitOption
- func KeepGitDir() GitOption
- func KnownSSHHosts(key string) GitOption
- func MountSSHSock(sshID string) GitOption
- type HTTPInfo
- type HTTPOption
- func Checksum(dgst digest.Digest) HTTPOption
- func Chmod(perm os.FileMode) HTTPOption
- func Chown(uid, gid int) HTTPOption
- func Filename(name string) HTTPOption
- type HostIP
- type ImageInfo
- type ImageMetaResolver
- type ImageOption
- func ResolveDigest(v bool) ImageOption
- func WithLayerLimit(l int) ImageOption
- func WithMetaResolver(mr ImageMetaResolver) ImageOption
- type KeyValue
- type LocalInfo
- type LocalOption
- func Differ(t DiffType, required bool) LocalOption
- func ExcludePatterns(p []string) LocalOption
- func FollowPaths(p []string) LocalOption
- func IncludePatterns(p []string) LocalOption
- func SessionID(id string) LocalOption
- func SharedKeyHint(h string) LocalOption
- type MarshalCache
- func (mc *MarshalCache) Cached(c *Constraints) bool
- func (mc *MarshalCache) Load() (digest.Digest, []byte, *pb.OpMetadata, []*SourceLocation, error)
- func (mc *MarshalCache) Store(dt []byte, md *pb.OpMetadata, srcs []*SourceLocation, c *Constraints)
- type MergeOp
- func NewMerge(inputs []State, c Constraints) *MergeOp
- func (m *MergeOp) Inputs() []Output
- func (m *MergeOp) Marshal(ctx context.Context, constraints *Constraints) (digest.Digest, []byte, *pb.OpMetadata, []*SourceLocation, error)
- func (m *MergeOp) Output() Output
- func (m *MergeOp) Validate(ctx context.Context, constraints *Constraints) error
- type MkdirInfo
- type MkdirOption
- type MkfileInfo
- type MkfileOption
- type MountInfo
- type MountOption
- func AsPersistentCacheDir(id string, sharing CacheMountSharingMode) MountOption
- func SourcePath(src string) MountOption
- func Tmpfs(opts ...TmpfsOption) MountOption
- type OCILayoutInfo
- type OCILayoutOption
- func OCILayerLimit(limit int) OCILayoutOption
- func OCIStore(sessionID string, storeID string) OCILayoutOption
- type Output
- type ProxyEnv
- type ResolveImageConfigOpt
- type ResolveImageConfigOptStore
- type ResolveMode
- type ResolverType
- 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 AddUlimit(name UlimitName, soft int64, hard int64) 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 WithCgroupParent(cp string) RunOption
- func WithProxy(ps ProxyEnv) RunOption
- type SSHInfo
- type SSHOption
- func SSHID(id string) SSHOption
- func SSHSocketOpt(target string, uid, gid, mode int) SSHOption
- func SSHSocketTarget(target string) SSHOption
- type SecretInfo
- type SecretOption
- func SecretAsEnv(v bool) SecretOption
- func SecretFileOpt(uid, gid, mode int) SecretOption
- func SecretID(id string) SecretOption
- type SourceLocation
- type SourceMap
- func NewSourceMap(st *State, filename string, dt []byte) *SourceMap
- func (s *SourceMap) Location(r []*pb.Range) ConstraintsOpt
- type SourceOp
- func NewSource(id string, attrs map[string]string, c Constraints) *SourceOp
- func (s *SourceOp) Inputs() []Output
- func (s *SourceOp) Marshal(ctx context.Context, constraints *Constraints) (digest.Digest, []byte, *pb.OpMetadata, []*SourceLocation, error)
- func (s *SourceOp) Output() Output
- func (s *SourceOp) Validate(ctx context.Context, c *Constraints) error
- type State
- func Diff(lower, upper State, opts ...ConstraintsOpt) State
- func Git(remote, ref string, opts ...GitOption) State
- func HTTP(url string, opts ...HTTPOption) State
- func Image(ref string, opts ...ImageOption) State
- func Local(name string, opts ...LocalOption) State
- func Merge(inputs []State, opts ...ConstraintsOpt) State
- func NewState(o Output) State
- func OCILayout(ref string, opts ...OCILayoutOption) State
- func Scratch() 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) AddUlimit(name UlimitName, soft int64, hard int64) State
- func (s State) Async(f func(context.Context, State, *Constraints) (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, co ...ConstraintsOpt) ([]string, error)
- func (s State) File(a *FileAction, opts ...ConstraintsOpt) State
- func (s State) GetArgs(ctx context.Context, co ...ConstraintsOpt) ([]string, error)
- func (s State) GetDir(ctx context.Context, co ...ConstraintsOpt) (string, error)
- func (s State) GetEnv(ctx context.Context, key string, co ...ConstraintsOpt) (string, bool, error)
- func (s State) GetHostname(ctx context.Context, co ...ConstraintsOpt) (string, error)
- func (s State) GetNetwork(ctx context.Context, co ...ConstraintsOpt) (pb.NetMode, error)
- func (s State) GetPlatform(ctx context.Context, co ...ConstraintsOpt) (*ocispecs.Platform, error)
- func (s State) GetSecurity(ctx context.Context, co ...ConstraintsOpt) (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 ocispecs.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, c *Constraints) error
- func (s State) Value(ctx context.Context, k interface{}, co ...ConstraintsOpt) (interface{}, error)
- func (s State) With(so ...StateOption) State
- func (s State) WithCgroupParent(cp string) 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
- func (fn StateOption) SetRunOption(ei *ExecInfo)
- type TmpfsInfo
- type TmpfsOption
- type UlimitName
- 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(ocispecs.Platform{OS: "linux", Architecture: "amd64"}) LinuxArmhf = Platform(ocispecs.Platform{OS: "linux", Architecture: "arm", Variant: "v7"}) LinuxArm = LinuxArmhf LinuxArmel = Platform(ocispecs.Platform{OS: "linux", Architecture: "arm", Variant: "v6"}) LinuxArm64 = Platform(ocispecs.Platform{OS: "linux", Architecture: "arm64"}) LinuxS390x = Platform(ocispecs.Platform{OS: "linux", Architecture: "s390x"}) LinuxPpc64 = Platform(ocispecs.Platform{OS: "linux", Architecture: "ppc64"}) LinuxPpc64le = Platform(ocispecs.Platform{OS: "linux", Architecture: "ppc64le"}) Darwin = Platform(ocispecs.Platform{OS: "darwin", Architecture: "amd64"}) Windows = Platform(ocispecs.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 SecretOptional = secretOptionFunc(func(si *SecretInfo) { si.Optional = true })
Functions ¶
func ForceNoOutput ¶
func ForceNoOutput(m *mount)
func MarshalConstraints ¶
func MarshalConstraints(base, override *Constraints) (*pb.Op, *pb.OpMetadata)
func Readonly ¶
func Readonly(m *mount)
func WriteTo ¶
func WriteTo(def *Definition, w io.Writer) error
Types ¶
type CacheMountSharingMode ¶
type CacheMountSharingMode int
const ( CacheMountSharingMode = iota CacheMountPrivate CacheMountLocked )
type ChownOpt ¶
func (ChownOpt) SetCopyOption ¶
func (ChownOpt) SetMkdirOption ¶
func (ChownOpt) SetMkfileOption ¶
func (co ChownOpt) SetMkfileOption(mi *MkfileInfo)
type ChownOption ¶
type ChownOption interface { MkdirOption MkfileOption CopyOption }
func WithUIDGID ¶
func WithUIDGID(uid, gid int) ChownOption
func WithUser ¶
func WithUser(name string) ChownOption
type Constraints ¶
type Constraints struct { Platform *ocispecs.Platform WorkerConstraints []string Metadata pb.OpMetadata LocalUniqueID string Caps *apicaps.CapSet SourceLocations []*SourceLocation }
func NewConstraints ¶
func NewConstraints(co ...ConstraintsOpt) *Constraints
type ConstraintsOpt ¶
type ConstraintsOpt interface { SetConstraintsOption(*Constraints) RunOption LocalOption HTTPOption ImageOption GitOption OCILayoutOption }
func LocalUniqueID ¶
func LocalUniqueID(v string) ConstraintsOpt
func Platform ¶
func Platform(p ocispecs.Platform) ConstraintsOpt
func ProgressGroup ¶
func ProgressGroup(id, name string, weak bool) 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 ¶
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 ¶
type CopyInfo struct { Mode *os.FileMode FollowSymlinks bool CopyDirContentsOnly bool IncludePatterns []string ExcludePatterns []string AttemptUnpack bool CreateDestPath bool AllowWildcard bool AllowEmptyWildcard bool ChownOpt *ChownOpt CreatedTime *time.Time }
func (*CopyInfo) SetCopyOption ¶
type CopyInput ¶
type CopyInput interface {
// contains filtered or unexported methods
}
CopyInput is either llb.State or *FileActionWithState
type CopyOption ¶
type CopyOption interface { SetCopyOption(*CopyInfo) }
type CreatedTime ¶
func WithCreatedTime ¶
func WithCreatedTime(t time.Time) CreatedTime
func (CreatedTime) SetCopyOption ¶
func (c CreatedTime) SetCopyOption(mi *CopyInfo)
func (CreatedTime) SetMkdirOption ¶
func (c CreatedTime) SetMkdirOption(mi *MkdirInfo)
func (CreatedTime) SetMkfileOption ¶
func (c CreatedTime) SetMkfileOption(mi *MkfileInfo)
type Definition ¶
type Definition struct { Def [][]byte Metadata map[digest.Digest]pb.OpMetadata Source *pb.Source Constraints *Constraints }
Definition is the LLB definition structure with per-vertex metadata entries Corresponds to the Definition structure defined in solver/pb.Definition.
func ReadFrom ¶
func ReadFrom(r io.Reader) (*Definition, error)
func (*Definition) FromPB ¶
func (def *Definition) FromPB(x *pb.Definition)
func (*Definition) Head ¶
func (def *Definition) Head() (digest.Digest, error)
func (*Definition) ToPB ¶
func (def *Definition) ToPB() *pb.Definition
type DefinitionOp ¶
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 ¶
func NewDefinitionOp(def *pb.Definition) (*DefinitionOp, error)
NewDefinitionOp returns a new operation from a marshalled definition.
func (*DefinitionOp) Inputs ¶
func (d *DefinitionOp) Inputs() []Output
func (*DefinitionOp) Marshal ¶
func (d *DefinitionOp) Marshal(ctx context.Context, c *Constraints) (digest.Digest, []byte, *pb.OpMetadata, []*SourceLocation, error)
func (*DefinitionOp) Output ¶
func (d *DefinitionOp) Output() Output
func (*DefinitionOp) ToInput ¶
func (d *DefinitionOp) ToInput(ctx context.Context, c *Constraints) (*pb.Input, error)
func (*DefinitionOp) Validate ¶
func (d *DefinitionOp) Validate(context.Context, *Constraints) error
func (*DefinitionOp) Vertex ¶
func (d *DefinitionOp) Vertex(context.Context, *Constraints) Vertex
type DiffOp ¶
type DiffOp struct { MarshalCache // contains filtered or unexported fields }
func NewDiff ¶
func NewDiff(lower, upper State, c Constraints) *DiffOp
func (*DiffOp) Inputs ¶
func (*DiffOp) Marshal ¶
func (m *DiffOp) Marshal(ctx context.Context, constraints *Constraints) (digest.Digest, []byte, *pb.OpMetadata, []*SourceLocation, error)
func (*DiffOp) Output ¶
func (*DiffOp) Validate ¶
func (m *DiffOp) Validate(ctx context.Context, constraints *Constraints) error
type DiffType ¶
type DiffType string
const ( // DiffNone will do no file comparisons, all files in the Local source will // be retransmitted. DiffNone DiffType = pb.AttrLocalDifferNone // DiffMetadata will compare file metadata (size, modified time, mode, owner, // group, device and link name) to determine if the files in the Local source need // to be retransmitted. This is the default behavior. DiffMetadata DiffType = pb.AttrLocalDifferMetadata )
type DifferInfo ¶
type EnvList ¶
type EnvList []KeyValue
func (EnvList) AddOrReplace ¶
func (EnvList) Delete ¶
func (EnvList) Get ¶
func (EnvList) Index ¶
func (EnvList) SetDefault ¶
func (EnvList) ToArray ¶
type ExecInfo ¶
type ExecInfo struct { State State Mounts []MountInfo ReadonlyRootFS bool ProxyEnv *ProxyEnv Secrets []SecretInfo SSH []SSHInfo // contains filtered or unexported fields }
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) GetMount ¶
func (*ExecOp) Inputs ¶
func (*ExecOp) Marshal ¶
func (e *ExecOp) Marshal(ctx context.Context, c *Constraints) (digest.Digest, []byte, *pb.OpMetadata, []*SourceLocation, error)
func (*ExecOp) Output ¶
func (*ExecOp) Validate ¶
func (e *ExecOp) Validate(ctx context.Context, c *Constraints) error
type ExecState ¶
type ExecState struct { State // contains filtered or unexported fields }
func (ExecState) AddMount ¶
func (e ExecState) AddMount(target string, source State, opt ...MountOption) State
func (ExecState) GetMount ¶
func (ExecState) Root ¶
type FileAction ¶
type FileAction struct {
// contains filtered or unexported fields
}
func Copy ¶
func Copy(input CopyInput, src, dest string, opts ...CopyOption) *FileAction
func Mkdir ¶
func Mkdir(p string, m os.FileMode, opt ...MkdirOption) *FileAction
func Mkfile ¶
func Mkfile(p string, m os.FileMode, dt []byte, opts ...MkfileOption) *FileAction
func Rm ¶
func Rm(p string, opts ...RmOption) *FileAction
func (*FileAction) Copy ¶
func (fa *FileAction) Copy(input CopyInput, src, dest string, opt ...CopyOption) *FileAction
func (*FileAction) Mkdir ¶
func (fa *FileAction) Mkdir(p string, m os.FileMode, opt ...MkdirOption) *FileAction
func (*FileAction) Mkfile ¶
func (fa *FileAction) Mkfile(p string, m os.FileMode, dt []byte, opt ...MkfileOption) *FileAction
func (*FileAction) Rm ¶
func (fa *FileAction) Rm(p string, opt ...RmOption) *FileAction
func (*FileAction) WithState ¶
func (fa *FileAction) WithState(s State) CopyInput
type FileOp ¶
type FileOp struct { MarshalCache // contains filtered or unexported fields }
func NewFileOp ¶
func NewFileOp(s State, action *FileAction, c Constraints) *FileOp
func (*FileOp) Inputs ¶
func (*FileOp) Marshal ¶
func (f *FileOp) Marshal(ctx context.Context, c *Constraints) (digest.Digest, []byte, *pb.OpMetadata, []*SourceLocation, error)
func (*FileOp) Output ¶
func (*FileOp) Validate ¶
func (f *FileOp) Validate(context.Context, *Constraints) error
type GitInfo ¶
type GitInfo struct { KeepGitDir bool AuthTokenSecret string AuthHeaderSecret string KnownSSHHosts string MountSSHSock string // contains filtered or unexported fields }
type GitOption ¶
type GitOption interface { SetGitOption(*GitInfo) }
func AuthHeaderSecret ¶
func AuthTokenSecret ¶
func KeepGitDir ¶
func KeepGitDir() GitOption
func KnownSSHHosts ¶
func MountSSHSock ¶
type HTTPInfo ¶
type HTTPInfo struct { Checksum digest.Digest Filename string Perm int UID int GID int // contains filtered or unexported fields }
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 HostIP ¶
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 ¶
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 WithLayerLimit ¶
func WithLayerLimit(l int) ImageOption
func WithMetaResolver ¶
func WithMetaResolver(mr ImageMetaResolver) ImageOption
WithMetaResolver adds a metadata resolver to an image
type KeyValue ¶
type KeyValue struct {
// contains filtered or unexported fields
}
type LocalInfo ¶
type LocalInfo struct { SessionID string IncludePatterns string ExcludePatterns string FollowPaths string string Differ DifferInfo // contains filtered or unexported fields }
type LocalOption ¶
type LocalOption interface { SetLocalOption(*LocalInfo) }
func Differ ¶
func Differ(t DiffType, required bool) LocalOption
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 MergeOp ¶
type MergeOp struct { MarshalCache // contains filtered or unexported fields }
func NewMerge ¶
func NewMerge(inputs []State, c Constraints) *MergeOp
func (*MergeOp) Inputs ¶
func (*MergeOp) Marshal ¶
func (m *MergeOp) Marshal(ctx context.Context, constraints *Constraints) (digest.Digest, []byte, *pb.OpMetadata, []*SourceLocation, error)
func (*MergeOp) Output ¶
func (*MergeOp) Validate ¶
func (m *MergeOp) Validate(ctx context.Context, constraints *Constraints) error
type MkdirInfo ¶
func (*MkdirInfo) SetMkdirOption ¶
type MkdirOption ¶
type MkdirOption interface { SetMkdirOption(*MkdirInfo) }
func WithParents ¶
func WithParents(b bool) MkdirOption
type MkfileInfo ¶
func (*MkfileInfo) SetMkfileOption ¶
func (mi *MkfileInfo) SetMkfileOption(mi2 *MkfileInfo)
type MkfileOption ¶
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(opts ...TmpfsOption) MountOption
type OCILayoutInfo ¶
type OCILayoutInfo struct {
// contains filtered or unexported fields
}
type OCILayoutOption ¶
type OCILayoutOption interface { SetOCILayoutOption(*OCILayoutInfo) }
func OCILayerLimit ¶
func OCILayerLimit(limit int) OCILayoutOption
func OCIStore ¶
func OCIStore(sessionID string, storeID string) OCILayoutOption
type Output ¶
type Output interface { ToInput(context.Context, *Constraints) (*pb.Input, error) Vertex(context.Context, *Constraints) Vertex }
type ProxyEnv ¶
type ProxyEnv struct { HTTPProxy string HTTPSProxy string FTPProxy string NoProxy string AllProxy string }
type ResolveImageConfigOpt ¶
type ResolveImageConfigOpt struct { ResolverType Platform *ocispecs.Platform ResolveMode string LogName string Store ResolveImageConfigOptStore }
type ResolveImageConfigOptStore ¶
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 ResolverType ¶
type ResolverType int
const ( ResolverTypeRegistry ResolverType = iota ResolverTypeOCILayout )
type RmInfo ¶
func (*RmInfo) SetRmOption ¶
type RmOption ¶
type RmOption interface { SetRmOption(*RmInfo) }
func WithAllowNotFound ¶
func WithAllowWildcard ¶
type RunOption ¶
type RunOption interface { SetRunOption(es *ExecInfo) }
func AddExtraHost ¶
func AddMount ¶
func AddMount(dest string, mountState State, opts ...MountOption) RunOption
func AddSSHSocket ¶
func AddSecret ¶
func AddSecret(dest string, opts ...SecretOption) RunOption
func AddUlimit ¶
func AddUlimit(name UlimitName, soft int64, hard int64) RunOption
func Args ¶
func ReadonlyRootFS ¶
func ReadonlyRootFS() RunOption
func Shlex ¶
func Shlexf ¶
func With ¶
func With(so ...StateOption) RunOption
func WithCgroupParent ¶
func WithProxy ¶
type SSHInfo ¶
type SSHOption ¶
type SSHOption interface { SetSSHOption(*SSHInfo) }
func SSHID ¶
func SSHSocketOpt ¶
func SSHSocketTarget ¶
type SecretInfo ¶
type SecretInfo struct { ID string Target string Mode int UID int GID int Optional bool IsEnv bool }
type SecretOption ¶
type SecretOption interface { SetSecretOption(*SecretInfo) }
func SecretAsEnv ¶
func SecretAsEnv(v bool) SecretOption
SecretAsEnv defines if the secret should be added as an environment variable
func SecretFileOpt ¶
func SecretFileOpt(uid, gid, mode int) SecretOption
func SecretID ¶
func SecretID(id string) SecretOption
type SourceLocation ¶
type SourceMap ¶
type SourceMap struct { State *State Definition *Definition Filename string Data []byte }
func NewSourceMap ¶
func (*SourceMap) Location ¶
func (s *SourceMap) Location(r []*pb.Range) ConstraintsOpt
type SourceOp ¶
type SourceOp struct { MarshalCache // contains filtered or unexported fields }
func NewSource ¶
func NewSource(id string, attrs map[string]string, c Constraints) *SourceOp
func (*SourceOp) Inputs ¶
func (*SourceOp) Marshal ¶
func (s *SourceOp) Marshal(ctx context.Context, constraints *Constraints) (digest.Digest, []byte, *pb.OpMetadata, []*SourceLocation, error)
func (*SourceOp) Output ¶
func (*SourceOp) Validate ¶
func (s *SourceOp) Validate(ctx context.Context, c *Constraints) error
type State ¶
type State struct {
// contains filtered or unexported fields
}
func Diff ¶
func Diff(lower, upper State, opts ...ConstraintsOpt) State
func Git ¶
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 Merge ¶
func Merge(inputs []State, opts ...ConstraintsOpt) State
func NewState ¶
func OCILayout ¶
func OCILayout(ref string, opts ...OCILayoutOption) State
func Scratch ¶
func Scratch() State
func (State) AddEnv ¶
func (State) AddEnvf ¶
func (State) AddExtraHost ¶
func (State) AddUlimit ¶
func (s State) AddUlimit(name UlimitName, soft int64, hard int64) State
func (State) Async ¶
func (State) Dir ¶
func (State) Dirf ¶
func (State) Env ¶
func (State) File ¶
func (s State) File(a *FileAction, opts ...ConstraintsOpt) State
func (State) GetArgs ¶
func (State) GetDir ¶
func (State) GetEnv ¶
func (State) GetHostname ¶
func (State) GetNetwork ¶
func (State) GetPlatform ¶
func (State) GetSecurity ¶
func (s State) GetSecurity(ctx context.Context, co ...ConstraintsOpt) (pb.SecurityMode, error)
func (State) Hostname ¶
func (State) Marshal ¶
func (s State) Marshal(ctx context.Context, co ...ConstraintsOpt) (*Definition, error)
func (State) Network ¶
func (State) Output ¶
func (State) Platform ¶
func (State) Reset ¶
func (State) Run ¶
func (State) Security ¶
func (s State) Security(n pb.SecurityMode) State
func (State) SetMarshalDefaults ¶
func (s State) SetMarshalDefaults(co ...ConstraintsOpt) State
func (State) User ¶
func (State) Validate ¶
func (s State) Validate(ctx context.Context, c *Constraints) error
func (State) Value ¶
func (s State) Value(ctx context.Context, k interface{}, co ...ConstraintsOpt) (interface{}, error)
func (State) With ¶
func (s State) With(so ...StateOption) State
func (State) WithCgroupParent ¶
func (State) WithImageConfig ¶
func (State) WithOutput ¶
func (State) WithValue ¶
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 ¶
func Hostname(str string) StateOption
func Network ¶
func Network(v pb.NetMode) StateOption
func Reset ¶
func Reset(other State) StateOption
func Security ¶
func Security(v pb.SecurityMode) StateOption
func User ¶
func User(str string) StateOption
func (StateOption) SetRunOption ¶
func (fn StateOption) SetRunOption(ei *ExecInfo)
type TmpfsInfo ¶
type TmpfsInfo struct { Size int64 }
type TmpfsOption ¶
type TmpfsOption interface { SetTmpfsOption(*TmpfsInfo) }
func TmpfsSize ¶
func TmpfsSize(b int64) TmpfsOption
type UlimitName ¶
type UlimitName string
const ( UlimitCore UlimitName = "core" UlimitCPU UlimitName = "cpu" UlimitData UlimitName = "data" UlimitFsize UlimitName = "fsize" UlimitLocks UlimitName = "locks" UlimitMemlock UlimitName = "memlock" UlimitMsgqueue UlimitName = "msgqueue" UlimitNice UlimitName = "nice" UlimitNofile UlimitName = "nofile" UlimitNproc UlimitName = "nproc" UlimitRss UlimitName = "rss" UlimitRtprio UlimitName = "rtprio" UlimitRttime UlimitName = "rttime" UlimitSigpending UlimitName = "sigpending" UlimitStack UlimitName = "stack" )
type UserOpt ¶
type Vertex ¶
type Vertex interface { Validate(context.Context, *Constraints) error Marshal(context.Context, *Constraints) (digest.Digest, []byte, *pb.OpMetadata, []*SourceLocation, error) Output() Output Inputs() []Output }
Source Files ¶
async.go definition.go diff.go exec.go fileop.go marshal.go merge.go meta.go resolver.go source.go sourcemap.go state.go
Directories ¶
Path | Synopsis |
---|---|
client/llb/imagemetaresolver | |
client/llb/llbbuild | |
client/llb/llbtest |
- Version
- v0.11.0-rc4
- Published
- Jan 6, 2023
- Platform
- js/wasm
- Imports
- 26 packages
- Last checked
- 2 seconds ago –
Tools for package owners.