Documentation
¶
Overview ¶
Package runner contains a utility to run Docker containers
Create a RunHelper with NewRunHelper and then create new run instances with New()
Index ¶
- type RunHelper
- type Runner
- func (h *Runner) Bind(binds ...string) *Runner
- func (h *Runner) Command(cmd ...string) *Runner
- func (h *Runner) Copy(contents map[string][]byte) *Runner
- func (h *Runner) Create() (string, error)
- func (h *Runner) DNS(address ...string) *Runner
- func (h *Runner) DiscardContainer() *Runner
- func (h *Runner) Entrypoint(cmd ...string) *Runner
- func (h *Runner) Env(env ...string) *Runner
- func (h *Runner) HostNetwork() *Runner
- func (h *Runner) HostPid() *Runner
- func (h *Runner) Image(image string) *Runner
- func (h *Runner) Name(name string) *Runner
- func (h *Runner) Output() (string, string, int, error)
- func (h *Runner) PortForward(local, remote int) *Runner
- func (h *Runner) Privileged() *Runner
- func (h *Runner) Run() (int, error)
- func (h *Runner) Start() (string, error)
- func (h *Runner) User(user string) *Runner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RunHelper ¶
type RunHelper struct {
// contains filtered or unexported fields
}
func NewRunHelper ¶
func NewRunHelper(dockerHelper *dockerhelper.Helper) *RunHelper
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner is a helper to run new containers on Docker
func (*Runner) Bind ¶
Bind tells Docker to bind host dirs to container dirs
func (*Runner) Command ¶
Command sets the command to run
func (*Runner) DiscardContainer ¶
DiscardContainer if true will cause the container to be removed when done executing. Will be ignored in the case of Start
func (*Runner) Entrypoint ¶
Entrypoint sets the entrypoint to use when running
func (*Runner) Env ¶
Env tells Docker to add environment variables to the container getting started
func (*Runner) HostNetwork ¶
HostNetwork tells Docker to run using the host's Network namespace
func (*Runner) HostPid ¶
HostPid tells Docker to run using the host's pid namespace
func (*Runner) Name ¶
Name sets the name of the container to create
func (*Runner) Output ¶
Output starts the container, waits for it to finish and returns its output
func (*Runner) Privileged ¶
Privileged tells Docker to run the container as privileged
func (*Runner) Run ¶
Run executes the container and waits until it completes
func (*Runner) Start ¶
Start starts the container as a daemon and returns