Documentation ¶
Index ¶
- type RunContext
- func (r *RunContext) AddEnv(key, value string) *RunContext
- func (r *RunContext) AddFromEnv(key string) *RunContext
- func (r *RunContext) AddOptions(options ...string) *RunContext
- func (r *RunContext) AddShared()
- func (r *RunContext) AddVolume(volume string) *RunContext
- func (r *RunContext) BuildOptions() (ret []string)
- func (r *RunContext) DefineContainerFuncs(addVolume func(string), addEnv func(string, string), ...)
- func (r *RunContext) GetFrom() (shared bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RunContext ¶
type RunContext struct {
// contains filtered or unexported fields
}
RunContext define a docker run collection of mount and env which can be re-used for a second container in DooD mode
func NewRunContext ¶
func NewRunContext(sharedName string, volumeSize int) (ret *RunContext)
NewRunContext create a new docker Run Context to shared
func (*RunContext) AddEnv ¶
func (r *RunContext) AddEnv(key, value string) *RunContext
AddEnv add a env option to the current Context
func (*RunContext) AddFromEnv ¶
func (r *RunContext) AddFromEnv(key string) *RunContext
AddFromEnv create a new docker run env (-e) from existing environment variable.
func (*RunContext) AddOptions ¶
func (r *RunContext) AddOptions(options ...string) *RunContext
AddOptions add a env option to the current Context
func (*RunContext) AddShared ¶
func (r *RunContext) AddShared()
AddShared return the shared variables with context options if shared == true
func (*RunContext) AddVolume ¶
func (r *RunContext) AddVolume(volume string) *RunContext
AddVolume add a volume option to the current Context
func (*RunContext) BuildOptions ¶
func (r *RunContext) BuildOptions() (ret []string)
BuildOptions creates an array of options for cmd.
func (*RunContext) DefineContainerFuncs ¶
func (r *RunContext) DefineContainerFuncs(addVolume func(string), addEnv func(string, string), addHiddenEnv func(string, string), addOptions func(...string))
DefineContainerFuncs define 3 container functions to update container options automatically.
func (*RunContext) GetFrom ¶
func (r *RunContext) GetFrom() (shared bool)
GetFrom buiild the docker Run Context from the shared name found from GetEnv