Documentation
¶
Index ¶
- Constants
- Variables
- func RecreateContainer(name string, dd Driver) error
- type ContainerBaseConfig
- type ContainerConfig
- type ContainerCreateOptions
- type ContainerCreateResponse
- type ContainerHostConfig
- type ContainerInspect
- type ContainerListOptions
- type ContainerNetworkConfig
- type ContainerNetworkingConfig
- type ContainerState
- type ContainerStatus
- type ContainerSummary
- type Driver
- type EndpointResource
- type ExecResult
- type HealthConfig
- type ImageInspect
- type ImageListOptions
- type ImageNotFoundError
- type ImagePullOptions
- type ImageSummary
- type Info
- type MountPoint
- type MountPropagation
- type MountType
- type NetworkCreateOptions
- type NetworkCreateResponse
- type NetworkEndpointSetting
- type NetworkInspect
- type NetworkListOptions
- type PmWriteCloser
- type Port
Constants ¶
View Source
const ( // defaultTimeout is the default timeout of short running docker operations. // Value is slightly offset from 2 minutes to make timeouts due to this // constant recognizable. DefaultTimeout = 2*time.Minute - 1*time.Second // defaultShmSize is the default ShmSize to use (in bytes) if not specified. DefaultShmSize = int64(1024 * 1024 * 64) // defaultImagePullingProgressReportInterval is the default interval of image pulling progress reporting. DefaultImagePullingProgressReportInterval = 10 * time.Second )
Variables ¶
View Source
var DockerDriver dockerClient
View Source
var PodmanDriver podmanClient
Functions ¶
func RecreateContainer ¶
Types ¶
type ContainerBaseConfig ¶
type ContainerConfig ¶
type ContainerCreateOptions ¶
type ContainerCreateOptions struct {
Name string
ContainerConfig *ContainerBaseConfig
HostConfig *ContainerHostConfig
NetworkingConfig *ContainerNetworkingConfig
}
type ContainerCreateResponse ¶
type ContainerHostConfig ¶
type ContainerHostConfig struct {
NetworkMode string
PortBindings nat.PortMap
Mounts []MountPoint
Privileged bool
}
type ContainerInspect ¶
type ContainerInspect struct {
// Base
ID string `json:"Id"`
Created time.Time `json:"Created"`
Path string `json:"Path"`
Args []string `json:"Args"`
State *ContainerState `json:"State"`
Image string `json:"Image"`
ImageName string `json:"ImageName"`
Name string `json:"Name"`
Mounts []MountPoint
Config ContainerConfig `json:"Config"`
NetworkSettings ContainerNetworkConfig `json:"NetworkSettings`
}
NOTE: ContainerJSONBase for docker
InspectContainerData for podman
type ContainerListOptions ¶
type ContainerNetworkConfig ¶
type ContainerNetworkingConfig ¶
type ContainerNetworkingConfig struct {
EndpointsConfig map[string]*NetworkEndpointSetting
}
type ContainerState ¶
type ContainerStatus ¶
type ContainerStatus int
type ContainerSummary ¶
type Driver ¶
type Driver interface {
New() error
ImageInspect(id string) (*ImageInspect, error)
ImagesList(options ImageListOptions) ([]ImageSummary, error)
ImagesPull(refStr string, options ImagePullOptions) ([]string, error)
ImageVersion(id string) (string, error)
ContainerCreate(options ContainerCreateOptions) (ContainerCreateResponse, error)
ContainerStart(id string) error
ContainerWait(id string, state string, timeout time.Duration, interval time.Duration) error
ContainerList(options ContainerListOptions) ([]ContainerSummary, error)
ContainerInspect(id string) (*ContainerInspect, error)
ContainerRestart(id string) error
ContainerStop(id string) error
ContainerRemove(id string) error
ContainerExec(id string, cmd []string) (ExecResult, error)
NetworkCreate(name string, options NetworkCreateOptions) (NetworkCreateResponse, error)
NetworkInspect(id string) (NetworkInspect, error)
NetworkRemove(id string) error
NetworkConnect(id string, container string, aliases []string) error
NetworkDisconnect(id string, container string, force bool) error
Info() (Info, error)
}
type EndpointResource ¶
corresponds to containers on a network
type ExecResult ¶
func (*ExecResult) Stderr ¶
func (res *ExecResult) Stderr() string
func (*ExecResult) Stdout ¶
func (res *ExecResult) Stdout() string
type HealthConfig ¶
type ImageInspect ¶
type ImageListOptions ¶
type ImageNotFoundError ¶
type ImageNotFoundError struct {
ID string
}
type ImagePullOptions ¶
type ImageSummary ¶
type MountPoint ¶
type MountPropagation ¶
type MountPropagation string
const ( PropagationRPrivate MountPropagation = "rprivate" PropagationPrivate MountPropagation = "private" )
TODO all propagation consts
type NetworkCreateOptions ¶
type NetworkCreateResponse ¶
type NetworkEndpointSetting ¶
type NetworkInspect ¶
type NetworkInspect struct {
Name string
NetworkID string
Containers map[string]EndpointResource
}
type NetworkListOptions ¶
type PmWriteCloser ¶
func (*PmWriteCloser) Close ¶
func (pwc *PmWriteCloser) Close() error
Click to show internal directories.
Click to hide internal directories.