Documentation ¶
Index ¶
- type Pool
- func (d *Pool) BuildAndRun(name, dockerfilePath string, env []string) (*Resource, error)
- func (d *Pool) BuildAndRunWithOptions(dockerfilePath string, opts *RunOptions) (*Resource, error)
- func (d *Pool) Purge(r *Resource) error
- func (d *Pool) Retry(op func() error) error
- func (d *Pool) Run(repository, tag string, env []string) (*Resource, error)
- func (d *Pool) RunWithOptions(opts *RunOptions) (*Resource, error)
- type Resource
- type RunOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pool ¶
Pool represents a connection to the docker API and is used to create and remove docker images.
func NewPool ¶
NewPool creates a new pool. You can pass an empty string to use the default, which is taken from the environment variable DOCKER_HOST and DOCKER_URL, or from docker-machine if the environment variable DOCKER_MACHINE_NAME is set, or if neither is defined a sensible default for the operating system you are on. TLS pools are automatically configured if the DOCKER_CERT_PATH environment variable exists.
func NewTLSPool ¶
NewTLSPool creates a new pool given an endpoint and the certificate path. This is required for endpoints that require TLS communication.
func (*Pool) BuildAndRun ¶
BuildAndRun builds and starts a docker container
func (*Pool) BuildAndRunWithOptions ¶
func (d *Pool) BuildAndRunWithOptions(dockerfilePath string, opts *RunOptions) (*Resource, error)
BuildAndRunWithOptions builds and starts a docker container
func (*Pool) Retry ¶
Retry is an exponential backoff retry helper. You can use it to wait for e.g. mysql to boot up.
func (*Pool) Run ¶
Run starts a docker container.
pool.Run("mysql", "5.3", []string{"FOO=BAR", "BAR=BAZ"})
func (*Pool) RunWithOptions ¶
func (d *Pool) RunWithOptions(opts *RunOptions) (*Resource, error)
RunWithOptions starts a docker container.
pool.Run(&RunOptions{Repository: "mongo", Cmd: []string{"mongod", "--smallfiles"}})
type RunOptions ¶
type RunOptions struct { Hostname string Name string Repository string Tag string Env []string Entrypoint []string Cmd []string Mounts []string Links []string ExposedPorts []string Auth dc.AuthConfiguration PortBindings map[dc.Port][]dc.PortBinding }
RunOptions is used to pass in optional parameters when running a container.