Documentation ¶
Overview ¶
Package command - command for the box builder
Documentation is deliberately simple here, it maps directly to the verbs and functions in the box builder documentation: https://box-builder.github.io/box. Duplicating it here seems pointless.
Index ¶
- Variables
- func ResetPulls()
- type Interpreter
- func (i *Interpreter) Cmd(cmds []string) error
- func (i *Interpreter) Copy(source, target string, ignoreList []string) error
- func (i *Interpreter) Debug(shell string) error
- func (i *Interpreter) Entrypoint(stringArgs []string) error
- func (i *Interpreter) Env(env map[string]string) error
- func (i *Interpreter) Flatten() error
- func (i *Interpreter) From(image string) error
- func (i *Interpreter) GetEnv(arg string) string
- func (i *Interpreter) GetGID(id string) (string, error)
- func (i *Interpreter) GetUID(id string) (string, error)
- func (i *Interpreter) Inside(p string, run func() error) error
- func (i *Interpreter) Label(labelMap map[string]string) error
- func (i *Interpreter) Read(filename string) (string, error)
- func (i *Interpreter) Run(command string, showRun bool) error
- func (i *Interpreter) Save(file, kind, tag string) error
- func (i *Interpreter) SetExec(execTargets map[string][]string) error
- func (i *Interpreter) Skip(run func() error) error
- func (i *Interpreter) Tag(name string) error
- func (i *Interpreter) User(username string) error
- func (i *Interpreter) Var(key string) (string, error)
- func (i *Interpreter) VarExists(key string) bool
- func (i *Interpreter) WithUser(username string, run func() error) error
- func (i *Interpreter) WorkDir(dir string) error
Constants ¶
This section is empty.
Variables ¶
var ErrNoImage = errors.New("no image base specified")
ErrNoImage reports when the image cannot be used because it was not specified.
Functions ¶
func ResetPulls ¶
func ResetPulls()
ResetPulls is a function to facilitate testing of the coordinated pull functionality.
Types ¶
type Interpreter ¶
type Interpreter struct { CacheKey string // if set to "", does not consider cache next step // contains filtered or unexported fields }
Interpreter is a set of statements combined with an executor used to compose images. It is driven by an evaluator.
func NewInterpreter ¶
func NewInterpreter(globals *types.Global, exec executor.Executor, vars map[string]string) *Interpreter
NewInterpreter contypes a new *Interpreter.
func (*Interpreter) Cmd ¶
func (i *Interpreter) Cmd(cmds []string) error
Cmd corresponds to the `cmd` verb.
func (*Interpreter) Copy ¶
func (i *Interpreter) Copy(source, target string, ignoreList []string) error
Copy implements `copy`
func (*Interpreter) Debug ¶
func (i *Interpreter) Debug(shell string) error
Debug corresponds to the `debug` verb.
func (*Interpreter) Entrypoint ¶
func (i *Interpreter) Entrypoint(stringArgs []string) error
Entrypoint is the `entrypoint` verb.
func (*Interpreter) Env ¶
func (i *Interpreter) Env(env map[string]string) error
Env corresponds to the `env` verb.
func (*Interpreter) From ¶
func (i *Interpreter) From(image string) error
From corresponds to the `from` verb.
func (*Interpreter) GetEnv ¶
func (i *Interpreter) GetEnv(arg string) string
GetEnv gets a value from the local environment.
func (*Interpreter) GetGID ¶
func (i *Interpreter) GetGID(id string) (string, error)
GetGID gets the GID for a group inside the container image currently in process.
func (*Interpreter) GetUID ¶
func (i *Interpreter) GetUID(id string) (string, error)
GetUID gets the UID for a user inside the container image currently in process.
func (*Interpreter) Inside ¶
func (i *Interpreter) Inside(p string, run func() error) error
Inside is the `inside` verb.
func (*Interpreter) Label ¶
func (i *Interpreter) Label(labelMap map[string]string) error
Label corresponds to the `label` verb.
func (*Interpreter) Read ¶
func (i *Interpreter) Read(filename string) (string, error)
Read reads a file from inside the container, and returns its contents.
func (*Interpreter) Run ¶
func (i *Interpreter) Run(command string, showRun bool) error
Run corresponds to the `run` verb
func (*Interpreter) Save ¶
func (i *Interpreter) Save(file, kind, tag string) error
Save corresponds to the `save` func.
func (*Interpreter) SetExec ¶
func (i *Interpreter) SetExec(execTargets map[string][]string) error
SetExec corresponds to the `set_exec` verb.
func (*Interpreter) Skip ¶
func (i *Interpreter) Skip(run func() error) error
Skip is the `skip` function.
func (*Interpreter) User ¶
func (i *Interpreter) User(username string) error
User is the `user` verb.
func (*Interpreter) Var ¶
func (i *Interpreter) Var(key string) (string, error)
Var corresponds to the `var` func.
func (*Interpreter) VarExists ¶
func (i *Interpreter) VarExists(key string) bool
VarExists corresponds to the `var_exists` func.
func (*Interpreter) WithUser ¶
func (i *Interpreter) WithUser(username string, run func() error) error
WithUser is the `with_user` verb.
func (*Interpreter) WorkDir ¶
func (i *Interpreter) WorkDir(dir string) error
WorkDir is the `workdir` verb.