container

package
v0.0.0-...-215933a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2016 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container struct {
	*resource.Status

	Name            string
	Image           string
	Entrypoint      []string
	Command         []string
	WorkingDir      string
	Env             []string
	Expose          []string
	Links           []string
	PortBindings    []string
	DNS             []string
	Volumes         []string
	VolumesFrom     []string
	PublishAllPorts bool
	CStatus         string
	Force           bool
	// contains filtered or unexported fields
}

Container is responsible for creating docker containers

func (*Container) Apply

func (c *Container) Apply() (resource.TaskStatus, error)

Apply starts a docker container with the specified configuration

func (*Container) Check

Check that a docker container with the specified configuration exists

func (*Container) SetClient

func (c *Container) SetClient(client docker.APIClient)

SetClient injects a docker api client

type Preparer

type Preparer struct {
	// name of the container
	Name string `hcl:"name" required:"true"`

	// the image name or ID to use for the container
	Image string `hcl:"image" required:"true"`

	// override the container entrypoint
	Entrypoint []string `hcl:"entrypoint"`

	// override the container command
	Command []string `hcl:"command"`

	// override the working directory of the container
	WorkingDir string `hcl:"working_dir"`

	// set environment variables in the container
	Env map[string]string `hcl:"env"`

	// additional ports to expose in the container
	Expose []string `hcl:"expose"`

	// A list of links for the container. Each link entry should be in the form of
	// container_name:alias
	Links []string `hcl:"links"`

	// publish container ports to the host. Each item should be in the following
	// format:
	// ip:hostPort:containerPort|ip::containerPort|hostPort:containerPort|containerPort.
	// Ports can be specified in the format: portnum/proto. If proto is not
	// specified, "tcp" is assumed
	Ports []string `hcl:"ports"`

	// list of DNS servers for the container to use
	DNS []string `hcl:"dns"`

	// bind mounts volumes
	Volumes []string `hcl:"volumes"`

	// mounts all volumes from the specified container
	VolumesFrom []string `hcl:"volumes_from"`

	// allocates a random host port for all of a container’s exposed ports.
	// Specified as a boolean value
	PublishAllPorts bool `hcl:"publish_all_ports"`

	// the desired status of the container.
	Status string `hcl:"status" valid_values:"running,created"`

	// indicates whether or not the container will be recreated if the state is
	// not what is expected. By default, the module will only check to see if the
	// container exists. Specified as a boolean value
	Force bool `hcl:"force"`
}

Preparer for docker containers

Container is responsible for creating docker containers. It assumes that there is already a Docker daemon running on the system.

func (*Preparer) Prepare

func (p *Preparer) Prepare(render resource.Renderer) (resource.Task, error)

Prepare a docker container

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL