Documentation
¶
Index ¶
- Constants
- type AuthConfig
- type Change
- type Config
- type ConfigAndHostConfig
- type Container
- type ContainerInfo
- type DeviceMapping
- type DockerClient
- func (client *DockerClient) Auth(auth *AuthConfig) (string, error)
- func (client *DockerClient) BuildImage(path, tag string, quiet bool) (string, error)
- func (client *DockerClient) CommitContainer(name, repo, tag, comment, author string, pause bool) (string, error)
- func (client *DockerClient) CopyContainer(name, path string) error
- func (client *DockerClient) CreateContainer(name string, config Config, hostConfig HostConfig) (string, error)
- func (client *DockerClient) ExportContainer(name string) error
- func (client *DockerClient) GetContainerChanges(name string) ([]Change, error)
- func (client *DockerClient) GetContainerLogs(name string, follow, stdout, stderr, timestamps bool, tail int) ([]string, error)
- func (client *DockerClient) GetContainerProcesses(name, ps_args string) (*Processes, error)
- func (client *DockerClient) GetImageHistory(name string) (ImageHistories, error)
- func (client *DockerClient) Info() (*Info, error)
- func (client *DockerClient) InspectContainer(name string) (*ContainerInfo, error)
- func (client *DockerClient) InspectImage(name string) (*ImageInfo, error)
- func (client *DockerClient) KillContainer(name, signal string) error
- func (client *DockerClient) ListContainers(all, size bool, limit int, since, before string, filters map[string][]string) ([]Container, error)
- func (client *DockerClient) ListImages(all bool, filters map[string][]string) ([]Image, error)
- func (client *DockerClient) PauseContainer(name string) error
- func (client *DockerClient) PullImage(name string) (string, error)
- func (client *DockerClient) PushImage(name, tag, credentials string) (string, error)
- func (client *DockerClient) RemoveContainer(name string, force bool) error
- func (client *DockerClient) RemoveImage(name string, force, noprune bool) error
- func (client *DockerClient) RestartContainer(name string, timeToWait int) error
- func (client *DockerClient) SearchImages(term string) (ImageSearchResults, error)
- func (client *DockerClient) StartContainer(name string) error
- func (client *DockerClient) StopContainer(name string, timeToWait int) error
- func (client *DockerClient) TagImage(name, repo, tag string, force bool) error
- func (client *DockerClient) UnpauseContainer(name string) error
- func (client *DockerClient) Upload(srcPath string, quiet bool) (string, error)
- func (client *DockerClient) Version() (*Version, error)
- func (client *DockerClient) WaitContainer(name string) (int, error)
- type Error
- type HostConfig
- type Image
- type ImageHistories
- type ImageHistory
- type ImageInfo
- type ImageSearchResult
- type ImageSearchResults
- type Info
- type JSONError
- type JSONMessage
- type JSONProgress
- type KeyValuePair
- type NetworkSettings
- type Port
- type PortBinding
- type Processes
- type RestartPolicy
- type SortImagesByName
- type SortImagesByStars
- type State
- type Version
Constants ¶
const ( DOCKERFILE = "Dockerfile" DOCKERIGNORE = ".dockerignore" )
const ( STREAM_HEADER_LENGTH = 8 STREAM_TYPE_INDEX = 0 STREAM_SIZE_INDEX = 4 STREAM_TYPE_STDIN = 0 STREAM_TYPE_STDOUT = 1 STREAM_TYPE_STDERR = 2 )
const ( CHANGE_TYPE_MODIFY = iota CHANGE_TYPE_ADD CHANGE_TYPE_DELETE )
const (
API_VERSION = "1.16"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthConfig ¶
type AuthConfig struct {
Username string `json:"username"`
Password string `json:"password"`
Email string `json:"email"`
ServerAddress string `json:"serveraddress"`
Auth string `json:"auth"`
}
func (*AuthConfig) Encode ¶
func (authConfig *AuthConfig) Encode() string
type Config ¶
type Config struct {
Hostname string
Domainname string
User string
Memory int64
MemorySwap int64
Cpuset string
AttachStderr bool
AttachStdin bool
AttachStdout bool
PortSpecs []string
ExposedPorts map[string]struct{}
Tty bool
OpenStdin bool
StdinOnce bool
Env []string
Cmd []string
Image string
Volumes map[string]struct{}
WorkingDir string
Entrypoint []string
NetworkDisabled bool
MacAddress string
OnBuild []string
}
https://github.com/docker/docker/blob/master/runconfig%2Fconfig.go#L11
type ConfigAndHostConfig ¶
type ConfigAndHostConfig struct {
Config
HostConfig HostConfig
}
https://github.com/docker/docker/blob/master/runconfig%2Fhostconfig.go#L126
type Container ¶
type Container struct {
Id string
Names []string
Image string
Command string
Created int64
Status string
Ports []Port
SizeRw int64
SizeRootFs int64
}
https://github.com/docker/docker/blob/master/daemon%2Flist.go#L123
type ContainerInfo ¶
type ContainerInfo struct {
Id string
Created time.Time
Path string
Args []string
Config Config
State State
Image string
NetworkSettings NetworkSettings
ResolvConfPath string
HostnamePath string
HostsPath string
Name string
RestartCount int
Driver string
ExecDriver string
MountLabel string
ProcessLabel string
Volumes map[string]string
VolumesRW map[string]bool
AppArmorProfile string
ExecIDs []string
HostConfig HostConfig
}
https://github.com/docker/docker/blob/master/daemon%2Finspect.go#L31 https://github.com/docker/docker/blob/master/daemon%2Fcontainer.go#L53
type DockerClient ¶
type DockerClient struct {
URL *url.URL
HTTPClient *http.Client
TLSConfig *tls.Config
// contains filtered or unexported fields
}
func NewDockerClient ¶
func (*DockerClient) Auth ¶
func (client *DockerClient) Auth(auth *AuthConfig) (string, error)
func (*DockerClient) BuildImage ¶
func (client *DockerClient) BuildImage(path, tag string, quiet bool) (string, error)
func (*DockerClient) CommitContainer ¶
func (client *DockerClient) CommitContainer(name, repo, tag, comment, author string, pause bool) (string, error)
func (*DockerClient) CopyContainer ¶
func (client *DockerClient) CopyContainer(name, path string) error
func (*DockerClient) CreateContainer ¶
func (client *DockerClient) CreateContainer(name string, config Config, hostConfig HostConfig) (string, error)
func (*DockerClient) ExportContainer ¶
func (client *DockerClient) ExportContainer(name string) error
func (*DockerClient) GetContainerChanges ¶
func (client *DockerClient) GetContainerChanges(name string) ([]Change, error)
func (*DockerClient) GetContainerLogs ¶
func (*DockerClient) GetContainerProcesses ¶
func (client *DockerClient) GetContainerProcesses(name, ps_args string) (*Processes, error)
func (*DockerClient) GetImageHistory ¶
func (client *DockerClient) GetImageHistory(name string) (ImageHistories, error)
func (*DockerClient) Info ¶
func (client *DockerClient) Info() (*Info, error)
func (*DockerClient) InspectContainer ¶
func (client *DockerClient) InspectContainer(name string) (*ContainerInfo, error)
func (*DockerClient) InspectImage ¶
func (client *DockerClient) InspectImage(name string) (*ImageInfo, error)
func (*DockerClient) KillContainer ¶
func (client *DockerClient) KillContainer(name, signal string) error
func (*DockerClient) ListContainers ¶
func (*DockerClient) ListImages ¶
func (*DockerClient) PauseContainer ¶
func (client *DockerClient) PauseContainer(name string) error
func (*DockerClient) PushImage ¶
func (client *DockerClient) PushImage(name, tag, credentials string) (string, error)
func (*DockerClient) RemoveContainer ¶
func (client *DockerClient) RemoveContainer(name string, force bool) error
func (*DockerClient) RemoveImage ¶
func (client *DockerClient) RemoveImage(name string, force, noprune bool) error
func (*DockerClient) RestartContainer ¶
func (client *DockerClient) RestartContainer(name string, timeToWait int) error
func (*DockerClient) SearchImages ¶
func (client *DockerClient) SearchImages(term string) (ImageSearchResults, error)
func (*DockerClient) StartContainer ¶
func (client *DockerClient) StartContainer(name string) error
func (*DockerClient) StopContainer ¶
func (client *DockerClient) StopContainer(name string, timeToWait int) error
func (*DockerClient) TagImage ¶
func (client *DockerClient) TagImage(name, repo, tag string, force bool) error
func (*DockerClient) UnpauseContainer ¶
func (client *DockerClient) UnpauseContainer(name string) error
func (*DockerClient) Upload ¶ added in v0.9.0
func (client *DockerClient) Upload(srcPath string, quiet bool) (string, error)
func (*DockerClient) Version ¶
func (client *DockerClient) Version() (*Version, error)
func (*DockerClient) WaitContainer ¶
func (client *DockerClient) WaitContainer(name string) (int, error)
type HostConfig ¶
type HostConfig struct {
Binds []string
ContainerIDFile string
LxcConf []KeyValuePair
Privileged bool
PortBindings map[string][]PortBinding
Links []string
PublishAllPorts bool
Dns []string
DnsSearch []string
ExtraHosts []string
VolumesFrom []string
Devices []DeviceMapping
NetworkMode string
IpcMode string
PidMode string
CapAdd []string
CapDrop []string
RestartPolicy RestartPolicy
SecurityOpt []string
ReadonlyRootfs bool
}
https://github.com/docker/docker/blob/master/runconfig%2Fhostconfig.go#L101
type Image ¶
type Image struct {
Created int64
Id string
ParentId string
RepoTags []string
Size int64
VirtualSize int64
}
https://github.com/docker/docker/blob/master/graph%2Flist.go#L72
type ImageHistories ¶
type ImageHistories []ImageHistory
func (ImageHistories) Len ¶
func (images ImageHistories) Len() int
func (ImageHistories) Less ¶
func (images ImageHistories) Less(i, j int) bool
func (ImageHistories) Swap ¶
func (images ImageHistories) Swap(i, j int)
type ImageInfo ¶
type ImageInfo struct {
Id string
Parent string
Comment string
Created time.Time
Container string
ContainerConfig Config
DockerVersion string
Author string
Config Config
Architecture string
Os string
Size int64
VirtualSize int64
Checksum string
}
https://github.com/docker/docker/blob/master/graph%2Fservice.go#L140 https://github.com/docker/docker/blob/master/image%2Fimage.go#L24
type ImageSearchResult ¶
type ImageSearchResults ¶
type ImageSearchResults []ImageSearchResult
func (ImageSearchResults) Len ¶
func (images ImageSearchResults) Len() int
func (ImageSearchResults) Swap ¶
func (images ImageSearchResults) Swap(i, j int)
type Info ¶
type Info struct {
ID string
Containers int
Images int
Driver string
DriverStatus [][]string
MemoryLimit interface{} // int or bool
SwapLimit interface{} // int or bool
IPv4Forwarding interface{} // int or bool
Debug interface{} // int or bool
NFd int
NGoroutines int
ExecutionDriver string
NEventsListener int
KernelVersion string
OperatingSystem string
IndexServerAddress string
InitSha1 string
InitPath string
NCPU int
MemTotal int64
DockerRootDir string
Name string
Labels []string
}
https://github.com/docker/docker/blob/master/daemon%2Finfo.go#L67
type JSONError ¶
type JSONMessage ¶
type JSONMessage struct {
Stream string `json:"stream,omitempty"`
Status string `json:"status,omitempty"`
Progress *JSONProgress `json:"progressDetail,omitempty"`
ProgressMessage string `json:"progress,omitempty"` //deprecated
ID string `json:"id,omitempty"`
From string `json:"from,omitempty"`
Time int64 `json:"time,omitempty"`
Error *JSONError `json:"errorDetail,omitempty"`
ErrorMessage string `json:"error,omitempty"` //deprecated
}
type JSONProgress ¶
type JSONProgress struct {
Current int `json:"current,omitempty"`
Total int `json:"total,omitempty"`
Start int64 `json:"start,omitempty"`
}
func (*JSONProgress) String ¶
func (p *JSONProgress) String() string
type NetworkSettings ¶
type NetworkSettings struct {
IPAddress string
IPPrefixLen int
MacAddress string
LinkLocalIPv6Address string
LinkLocalIPv6PrefixLen int
GlobalIPv6Address string
GlobalIPv6PrefixLen int
Gateway string
IPv6Gateway string
Bridge string
Ports map[string][]PortBinding
}
https://github.com/docker/docker/blob/master/daemon%2Fnetwork_settings.go#L11
type SortImagesByName ¶
type SortImagesByName struct {
ImageSearchResults
}
func (SortImagesByName) Less ¶
func (by SortImagesByName) Less(i, j int) bool
type SortImagesByStars ¶
type SortImagesByStars struct {
ImageSearchResults
}
func (SortImagesByStars) Less ¶
func (by SortImagesByStars) Less(i, j int) bool