Documentation
¶
Index ¶
- Constants
- Variables
- type Client
- type Config
- type Container
- type ContainerService
- func (c *ContainerService) Attach(id string, out io.Writer) error
- func (c *ContainerService) Create(conf *Config) (*Run, error)
- func (c *ContainerService) Inspect(id string) (*Container, error)
- func (c *ContainerService) List() ([]*Containers, error)
- func (c *ContainerService) ListAll() ([]*Containers, error)
- func (c *ContainerService) Remove(id string) error
- func (c *ContainerService) Run(conf *Config, host *HostConfig, out io.Writer) (*Wait, error)
- func (c *ContainerService) RunDaemon(conf *Config, host *HostConfig) (*Run, error)
- func (c *ContainerService) RunDaemonPorts(image string, ports map[Port]struct{}) (*Run, error)
- func (c *ContainerService) Start(id string, conf *HostConfig) error
- func (c *ContainerService) Stop(id string, timeout int) error
- func (c *ContainerService) Wait(id string) (*Wait, error)
- type Containers
- type Delete
- type HostConfig
- type Image
- type ImageService
- func (c *ImageService) Build(tag, dir string) error
- func (c *ImageService) Create(image string) error
- func (c *ImageService) Inspect(name string) (*Image, error)
- func (c *ImageService) List() ([]*Images, error)
- func (c *ImageService) Pull(image string) error
- func (c *ImageService) PullTag(name, tag string) error
- func (c *ImageService) Remove(image string) ([]*Delete, error)
- type Images
- type KeyValuePair
- type NetworkSettings
- type Port
- type PortBinding
- type PortMapping
- type Run
- type State
- type Top
- type Wait
Constants ¶
View Source
const ( APIVERSION = 1.9 DEFAULTHTTPPORT = 4243 DEFAULTUNIXSOCKET = "/var/run/docker.sock" DEFAULTPROTOCOL = "unix" DEFAULTTAG = "latest" VERSION = "0.8.0" )
Variables ¶
View Source
var ( // Returned if the specified resource does not exist. ErrNotFound = errors.New("Not Found") // Returned if the caller attempts to make a call or modify a resource // for which the caller is not authorized. // // The request was a valid request, the caller's authentication credentials // succeeded but those credentials do not grant the caller permission to // access the resource. ErrForbidden = errors.New("Forbidden") // Returned if the call requires authentication and either the credentials // provided failed or no credentials were provided. ErrNotAuthorized = errors.New("Unauthorized") // Returned if the caller submits a badly formed request. For example, // the caller can receive this return if you forget a required parameter. ErrBadRequest = errors.New("Bad Request") )
View Source
var Logging = true
Enables verbose logging to the Terminal window
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
Images *ImageService
Containers *ContainerService
// contains filtered or unexported fields
}
type Config ¶
type Config struct {
Hostname string
Domainname string
User string
Memory int64 // Memory limit (in bytes)
MemorySwap int64 // Total memory usage (memory + swap); set `-1' to disable swap
AttachStdin bool
AttachStdout bool
AttachStderr bool
PortSpecs []string // Deprecated - Can be in the format of 8080/tcp
ExposedPorts map[Port]struct{}
Tty bool // Attach standard streams to a tty, including stdin if it is not closed.
OpenStdin bool // Open stdin
StdinOnce bool // If true, close stdin after the 1 attached client disconnects.
Env []string
Cmd []string
Dns []string
Image string // Name of the image as it was passed by the operator (eg. could be symbolic)
Volumes map[string]struct{}
VolumesFrom string
WorkingDir string
Entrypoint []string
NetworkDisabled bool
}
type Container ¶
type Container struct {
ID string
Created time.Time
Path string
Args []string
Config *Config
State State
Image string
NetworkSettings *NetworkSettings
SysInitPath string
ResolvConfPath string
HostnamePath string
HostsPath string
Name string
Driver string
Volumes map[string]string
// Store rw/ro in a separate structure to preserve reverse-compatibility on-disk.
// Easier than migrating older container configs :)
VolumesRW map[string]bool
}
type ContainerService ¶
type ContainerService struct {
*Client
}
func (*ContainerService) Attach ¶
func (c *ContainerService) Attach(id string, out io.Writer) error
Attach to the container to stream the stdout and stderr
func (*ContainerService) Create ¶
func (c *ContainerService) Create(conf *Config) (*Run, error)
Create a Container
func (*ContainerService) Inspect ¶
func (c *ContainerService) Inspect(id string) (*Container, error)
Stop the container id
func (*ContainerService) List ¶
func (c *ContainerService) List() ([]*Containers, error)
List only running containers.
func (*ContainerService) ListAll ¶
func (c *ContainerService) ListAll() ([]*Containers, error)
List all containers
func (*ContainerService) Remove ¶
func (c *ContainerService) Remove(id string) error
Remove the container id from the filesystem.
func (*ContainerService) Run ¶
func (c *ContainerService) Run(conf *Config, host *HostConfig, out io.Writer) (*Wait, error)
Run the container
func (*ContainerService) RunDaemon ¶
func (c *ContainerService) RunDaemon(conf *Config, host *HostConfig) (*Run, error)
Run the container as a Daemon
func (*ContainerService) RunDaemonPorts ¶
func (c *ContainerService) RunDaemonPorts(image string, ports map[Port]struct{}) (*Run, error)
func (*ContainerService) Start ¶
func (c *ContainerService) Start(id string, conf *HostConfig) error
Start the container id
type Containers ¶
type HostConfig ¶
type HostConfig struct {
Binds []string
ContainerIDFile string
LxcConf []KeyValuePair
Privileged bool
PortBindings map[Port][]PortBinding
Links []string
PublishAllPorts bool
}
type Image ¶
type Image struct {
ID string `json:"id"`
Parent string `json:"parent,omitempty"`
Comment string `json:"comment,omitempty"`
Created time.Time `json:"created"`
Container string `json:"container,omitempty"`
ContainerConfig Config `json:"container_config,omitempty"`
DockerVersion string `json:"docker_version,omitempty"`
Author string `json:"author,omitempty"`
Config *Config `json:"config,omitempty"`
Architecture string `json:"architecture,omitempty"`
OS string `json:"os,omitempty"`
Size int64
}
type ImageService ¶
type ImageService struct {
*Client
}
func (*ImageService) Create ¶
func (c *ImageService) Create(image string) error
Create an image, either by pull it from the registry or by importing it.
func (*ImageService) Inspect ¶
func (c *ImageService) Inspect(name string) (*Image, error)
Inspect the image
func (*ImageService) Pull ¶
func (c *ImageService) Pull(image string) error
func (*ImageService) PullTag ¶
func (c *ImageService) PullTag(name, tag string) error
type KeyValuePair ¶
type NetworkSettings ¶
type NetworkSettings struct {
IPAddress string
IPPrefixLen int
Gateway string
Bridge string
PortMapping map[string]PortMapping // Deprecated
Ports map[Port][]PortBinding
}
type PortBinding ¶
type PortMapping ¶
Click to show internal directories.
Click to hide internal directories.