Documentation ¶
Overview ¶
Package docker 提供与本机 Docker 守护进程交互的功能;包括镜像管理,容器启动
Index ¶
- type Client
- func (c *Client) BuildFromPath(path, tag string) (imageID string, err error)
- func (c *Client) BuildFromTar(tar io.Reader, tag string) (imageID string, err error)
- func (c *Client) ContainerIsRunningByImage(image string) (isRunning bool, err error)
- func (c *Client) ContainerKillByImage(image string, signal string) (err error)
- func (c *Client) ContainerList() ([]types.Container, error)
- func (c *Client) ContainerRestartByImage(image string) (err error)
- func (c *Client) ContainerRun(image string, conf container.Config, hostConf container.HostConfig) (containerID string, err error)
- func (c *Client) GetContainerByImage(image string) (id string, err error)
- func (c *Client) GetImageNewestTag(img Image) (tag string, err error)
- func (c *Client) ImageLoad(target string) (err error)
- func (c *Client) ImageRemove(refStr string) (err error)
- func (c *Client) ImageSave(target string, imgs ...string) (err error)
- func (c *Client) Inspect(imageID string) (inspect types.ImageInspect, err error)
- func (c *Client) IsImageAdd(refStr string) (isAdded bool)
- func (c *Client) IsImageNewest() (isNewest bool, err error)
- func (c *Client) Pull(refStr string) (err error)
- func (c *Client) RemoveContainer(image string) (err error)
- func (c *Client) StopContainer(image string) (err error)
- type ErrorDetail
- type Image
- type LineResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
func (*Client) BuildFromPath ¶
func (*Client) BuildFromTar ¶
func (*Client) ContainerIsRunningByImage ¶
ContainerIsRunningByImage 返回是否有镜像对应的容器在运行
func (*Client) ContainerKillByImage ¶ added in v1.9.1
ContainerKillByImage 给容器发送信号
func (*Client) ContainerList ¶ added in v1.9.1
ContainerList 返回启动的容器列表
func (*Client) ContainerRestartByImage ¶
ContainerRestartByImage 重启容器
func (*Client) ContainerRun ¶ added in v1.5.0
func (c *Client) ContainerRun(image string, conf container.Config, hostConf container.HostConfig) (containerID string, err error)
ContainerRun 根据镜像创建容器并运行
func (*Client) GetContainerByImage ¶
func (*Client) GetImageNewestTag ¶ added in v1.5.0
func (*Client) ImageRemove ¶
ImageRemove 删除镜像
func (*Client) Inspect ¶
func (c *Client) Inspect(imageID string) (inspect types.ImageInspect, err error)
func (*Client) IsImageAdd ¶
IsImageAdd 镜像是否已经拉取到本地
func (*Client) IsImageNewest ¶
IsImageNewest TODO 镜像是否最新
func (*Client) RemoveContainer ¶ added in v1.9.1
RemoveContainer 删除容器 TODO 优化
func (*Client) StopContainer ¶ added in v1.9.1
StopContainer 停止容器 TODO 优化
type ErrorDetail ¶
type ErrorDetail struct {
Message string `json:"message"`
}
type Image ¶
type Image struct { Name string `json:"name" yaml:"name"` Tag string `json:"tag" yaml:"tag"` // 镜像标签 Registry string `json:"registry" yaml:"registry"` // 仓库地址 }
Image 镜像
func (Image) Repository ¶
type LineResult ¶
type LineResult struct { Stream string `json:"stream"` AUX struct { ID string `json:"id"` } `json:"aux"` Error string `json:"error"` ErrorDetail ErrorDetail `json:"errorDetail"` }
Click to show internal directories.
Click to hide internal directories.