docker

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2015 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEth0Ip

func GetEth0Ip() ([]string, error)

Note that this depends on the context in which it is run. If this is run from the host (outside container), then it will return the address at eth0, but if it's run from inside a container, the eth0 interface is actually the docker0 interface on the host.

Types

type Action

type Action int
const (
	Create Action = iota
	Start
	Stop
	Remove
	Die
)

type AuthIdentity

type AuthIdentity struct {
	_docker.AuthConfiguration
}

type Config

type Config struct {
	Email    string
	Auth     string
	Account  string
	TestMode bool
}

func (*Config) GenerateDockerCfg

func (this *Config) GenerateDockerCfg(path string) error

func (*Config) NewImage

func (this *Config) NewImage(repo string, build int64, dockerFile string) (*docker_build, error)

func (*Config) NewTaggedImage

func (this *Config) NewTaggedImage(tag string, dockerFile string) (*docker_build, error)

type Container

type Container struct {
	Id      string `json:"id"`
	Ip      string `json:"ip"`
	Image   string `json:"image"`
	ImageId string `json:"image_id"`

	Name    string `json:"name"`
	Command string `json:"command"`
	Ports   []Port `json:"ports"`
	Network _docker.NetworkSettings

	DockerData *_docker.Container `json:"docker_data"`
	// contains filtered or unexported fields
}

func (*Container) Inspect

func (c *Container) Inspect() error

type ContainerControl

type ContainerControl struct {
	*_docker.Config

	// If false, the container starts up in daemon mode (as a service) - default
	RunOnce       bool                `json:"run_once,omitempty"`
	HostConfig    *_docker.HostConfig `json:"host_config"`
	ContainerName string              `json:"name,omitempty"`
}

type Docker

type Docker struct {
	Endpoint string

	Cert string
	Key  string
	Ca   string

	ContainerCreated func(*Container)
	ContainerStarted func(*Container)
	// contains filtered or unexported fields
}

func NewClient

func NewClient(endpoint string) (c *Docker, err error)

func NewTLSClient

func NewTLSClient(endpoint string, cert, key, ca string) (c *Docker, err error)

Endpoint and file paths

func (*Docker) FindContainers

func (c *Docker) FindContainers(filter map[string][]string) ([]*Container, error)

func (*Docker) FindContainersByName

func (c *Docker) FindContainersByName(name string) ([]*Container, error)

func (*Docker) ListContainers

func (c *Docker) ListContainers() ([]*Container, error)

func (*Docker) PullImage

func (c *Docker) PullImage(auth *AuthIdentity, image *Image) (<-chan error, error)

func (*Docker) RemoveContainer

func (c *Docker) RemoveContainer(auth *AuthIdentity, id string, removeVolumes, force bool) error

func (*Docker) RemoveImage

func (c *Docker) RemoveImage(image string, force, prune bool) error

func (*Docker) StartContainer

func (c *Docker) StartContainer(auth *AuthIdentity, ct *ContainerControl) (*Container, error)

func (*Docker) StopContainer

func (c *Docker) StopContainer(auth *AuthIdentity, id string, timeout time.Duration) error

func (*Docker) WatchContainer

func (c *Docker) WatchContainer(notify func(Action, *Container)) (chan<- bool, error)

func (*Docker) WatchContainerMatching

func (c *Docker) WatchContainerMatching(accept func(Action, *Container) bool, notify func(Action, *Container)) (chan<- bool, error)

type Image

type Image struct {
	Registry   string `json:"registry"`
	Repository string `json:"repository"`
	Tag        string `json:"tag"`
}

func ParseImageUrl

func ParseImageUrl(url string) Image

func (Image) ImageString

func (this Image) ImageString() string

func (Image) Url

func (this Image) Url() string

type Port

type Port struct {
	ContainerPort int64  `json:"container_port"`
	HostPort      int64  `json:"host_port"`
	Type          string `json:"protocol"`
	AcceptIP      string `json:"accepts_ip"`
}

Jump to

Keyboard shortcuts

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