Documentation
¶
Index ¶
- Constants
- Variables
- func IsLocalOverride(m Metadata) bool
- func NameOf(m Metadata) string
- type AlwaysRun
- type AsSpec
- type Buildable
- type BuildableSpec
- type EnvOverrides
- type Graph
- type GraphOpt
- type GraphOptFunc
- type Image
- type Layer
- type LayerSpecOpt
- func BuildArgs(args ...string) LayerSpecOpt
- func BuildDep(asSpec AsSpec) LayerSpecOpt
- func BuildEnv(k string, v string) LayerSpecOpt
- func BuildScratch(dest string) LayerSpecOpt
- func BuildScript(lines ...string) LayerSpecOpt
- func Dep(asSpec AsSpec) LayerSpecOpt
- func Env(k string, v string) LayerSpecOpt
- func MergeLayerSpecOpts(opts ...LayerSpecOpt) LayerSpecOpt
- func Name(name string) LayerSpecOpt
- func RunArgs(args ...string) LayerSpecOpt
- func RunDep(asSpec AsSpec) LayerSpecOpt
- func RunEnv(k string, v string) LayerSpecOpt
- func RunScript(lines ...string) LayerSpecOpt
- func RunWorkingDir(dir string) LayerSpecOpt
- type LayerSpecOptFunc
- type LayerSpecOpts
- type Local
- type LocalOverride
- type MarshalLayer
- type Metadata
- type MountDir
- type OutputDir
- type Spec
- type SpecOpt
- type SpecOptFunc
Constants ¶
View Source
const EnvOverridesPrefix = "BINCASTLE_OVERRIDE_"
Variables ¶
View Source
var SkipDeps = errors.New("skipping deps during walk")
View Source
var StopWalk = errors.New("stopping walk")
Functions ¶
func IsLocalOverride ¶
Types ¶
type AlwaysRun ¶
type AlwaysRun bool
TODO better name?
func (AlwaysRun) ApplyToLayerSpecOpts ¶
func (alwaysRun AlwaysRun) ApplyToLayerSpecOpts(ls LayerSpecOpts) LayerSpecOpts
type AsSpec ¶
type AsSpec interface {
Spec() Spec
}
type BuildableSpec ¶
type BuildableSpec struct {
Buildable
}
BuildableSpec upgrades a Buildable w/ some generic methods that allow it to satisfy the full Spec interface
func (BuildableSpec) Spec ¶
func (s BuildableSpec) Spec() Spec
func (BuildableSpec) With ¶
func (s BuildableSpec) With(opts ...SpecOpt) Spec
type EnvOverrides ¶
type EnvOverrides struct{}
func (EnvOverrides) ApplyToSpec ¶
func (EnvOverrides) ApplyToSpec(s AsSpec) AsSpec
type Graph ¶
type Graph struct {
// contains filtered or unexported fields
}
func Build ¶
TODO docs, creates a transitively reduced graph of layers from the specs, transitive reduction gives consistent, easy-to-understand and minimized result that I think matches most closely what you usually mean when you specify the existence of a dep.
func (*Graph) DumpDot ¶
TODO it would probably be better to just expose Walk and have this and similar implementations exist outside Graph directly
func (*Graph) MarshalLayers ¶
func (g *Graph) MarshalLayers(ctx context.Context, co ...llb.ConstraintsOpt) ([]MarshalLayer, error)
type GraphOpt ¶
func AppendOutputDir ¶
type GraphOptFunc ¶
func (GraphOptFunc) ApplyToGraph ¶
func (f GraphOptFunc) ApplyToGraph(g *Graph) *Graph
type LayerSpecOpt ¶
type LayerSpecOpt interface {
ApplyToLayerSpecOpts(LayerSpecOpts) LayerSpecOpts
}
func BuildArgs ¶
func BuildArgs(args ...string) LayerSpecOpt
func BuildDep ¶
func BuildDep(asSpec AsSpec) LayerSpecOpt
func BuildEnv ¶
func BuildEnv(k string, v string) LayerSpecOpt
func BuildScratch ¶
func BuildScratch(dest string) LayerSpecOpt
func BuildScript ¶
func BuildScript(lines ...string) LayerSpecOpt
func Dep ¶
func Dep(asSpec AsSpec) LayerSpecOpt
func Env ¶
func Env(k string, v string) LayerSpecOpt
func MergeLayerSpecOpts ¶
func MergeLayerSpecOpts(opts ...LayerSpecOpt) LayerSpecOpt
func Name ¶
func Name(name string) LayerSpecOpt
TODO maybe there should be support for multiple Names?
func RunArgs ¶
func RunArgs(args ...string) LayerSpecOpt
func RunDep ¶
func RunDep(asSpec AsSpec) LayerSpecOpt
func RunEnv ¶
func RunEnv(k string, v string) LayerSpecOpt
func RunScript ¶
func RunScript(lines ...string) LayerSpecOpt
func RunWorkingDir ¶
func RunWorkingDir(dir string) LayerSpecOpt
type LayerSpecOptFunc ¶
type LayerSpecOptFunc func(LayerSpecOpts) LayerSpecOpts
func (LayerSpecOptFunc) ApplyToLayerSpecOpts ¶
func (f LayerSpecOptFunc) ApplyToLayerSpecOpts(ls LayerSpecOpts) LayerSpecOpts
type LayerSpecOpts ¶
type LayerSpecOpts struct { BuildDeps []AsSpec BaseState llb.State BuildExecOpts []llb.RunOption RunDeps []AsSpec MountDir string OutputDir string RunArgs []string RunEnv map[string]string RunWorkingDir string // contains filtered or unexported fields }
func (LayerSpecOpts) Apply ¶
func (ls LayerSpecOpts) Apply(opts ...LayerSpecOpt) *LayerSpecOpts
func (*LayerSpecOpts) Build ¶
func (ls *LayerSpecOpts) Build(depGraphs []*Graph) *Graph
func (*LayerSpecOpts) Deps ¶
func (ls *LayerSpecOpts) Deps() []AsSpec
func (LayerSpecOpts) Metadata ¶
func (ls LayerSpecOpts) Metadata(key interface{}) interface{}
func (*LayerSpecOpts) SetValue ¶
func (ls *LayerSpecOpts) SetValue(key interface{}, value interface{})
type LocalOverride ¶
type LocalOverride bool
func (LocalOverride) ApplyToLayerSpecOpts ¶
func (o LocalOverride) ApplyToLayerSpecOpts(ls LayerSpecOpts) LayerSpecOpts
type MarshalLayer ¶
type MarshalLayer struct { LLB []byte `json:"LLB"` OutputDir string `json:"OutputDir"` MountDir string `json:"MountDir"` Env []string `json:"Env"` Args []string `json:"Args"` WorkingDir string `json:"WorkingDir"` // contains filtered or unexported fields }
func UnmarshalLayers ¶
func UnmarshalLayers(b []byte) ([]MarshalLayer, error)
type MountDir ¶
type MountDir string
func (MountDir) ApplyToGraph ¶
func (MountDir) ApplyToLayerSpecOpts ¶
func (dir MountDir) ApplyToLayerSpecOpts(ls LayerSpecOpts) LayerSpecOpts
type OutputDir ¶
type OutputDir string
func (OutputDir) ApplyToLayerSpecOpts ¶
func (dir OutputDir) ApplyToLayerSpecOpts(ls LayerSpecOpts) LayerSpecOpts
type Spec ¶
type Spec interface { Buildable AsSpec // TODO add AsGraph method that allows this to be converted to a Graph? With(opts ...SpecOpt) Spec }
func LayerSpec ¶
func LayerSpec(opts ...LayerSpecOpt) Spec
type SpecOpt ¶
func LocalOverrides ¶
overrides is a map of layer name -> local path to use instead
func Overridden ¶
type SpecOptFunc ¶
func (SpecOptFunc) ApplyToSpec ¶
func (f SpecOptFunc) ApplyToSpec(s AsSpec) AsSpec
Click to show internal directories.
Click to hide internal directories.