Documentation ¶
Index ¶
- type Client
- func (c *Client) CheckCli() error
- func (c *Client) Close()
- func (c *Client) Connect(host string) (err error)
- func (c *Client) ContainerCreate(containerName string, config *container.Config, ...) (rsp container.CreateResponse, err error)
- func (c *Client) ContainerInspect(containerId string) (rsp types.ContainerJSON, err error)
- func (c *Client) ContainerList(options types.ContainerListOptions) (list []types.Container, err error)
- func (c *Client) ContainerLogs(containerId string, options types.ContainerLogsOptions) (out string, err error)
- func (c *Client) ContainerRemove(containerId string, options types.ContainerRemoveOptions) (err error)
- func (c *Client) ContainerStart(containerId string, options types.ContainerStartOptions) (err error)
- func (c *Client) ContainerStop(containerId string, options container.StopOptions) (err error)
- func (c *Client) GenerateUserPwdAuth(username string, password string) string
- func (c *Client) ImageInspect(image string) (info types.ImageInspect, err error)
- func (c *Client) ImageList(options types.ImageListOptions) (list []types.ImageSummary, err error)
- func (c *Client) ImagePull(image string, options types.ImagePullOptions) (out string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Docker连接
func (*Client) Connect ¶
连接操作 host有值(例如"http://127.0.0.1:1234"),则连接到远程docker上 host为空,则连接到/var/run/docker.sock上
func (*Client) ContainerCreate ¶
func (c *Client) ContainerCreate( containerName string, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, platformConfig *specs.Platform, ) (rsp container.CreateResponse, err error)
创建容器
func (*Client) ContainerInspect ¶
func (c *Client) ContainerInspect( containerId string, ) (rsp types.ContainerJSON, err error)
获取容器信息
func (*Client) ContainerList ¶
func (c *Client) ContainerList( options types.ContainerListOptions, ) (list []types.Container, err error)
获取所有容器信息
func (*Client) ContainerLogs ¶
func (c *Client) ContainerLogs( containerId string, options types.ContainerLogsOptions, ) (out string, err error)
查看容器日志
func (*Client) ContainerRemove ¶
func (c *Client) ContainerRemove( containerId string, options types.ContainerRemoveOptions, ) (err error)
移除容器
func (*Client) ContainerStart ¶
func (c *Client) ContainerStart( containerId string, options types.ContainerStartOptions, ) (err error)
启动容器
func (*Client) ContainerStop ¶
func (c *Client) ContainerStop( containerId string, options container.StopOptions, ) (err error)
停止容器
func (*Client) GenerateUserPwdAuth ¶
简易的用户名+密码鉴权信息
func (*Client) ImageInspect ¶
func (c *Client) ImageInspect( image string, ) (info types.ImageInspect, err error)
获取镜像信息
func (*Client) ImageList ¶
func (c *Client) ImageList( options types.ImageListOptions, ) (list []types.ImageSummary, err error)
获取镜像列表
Click to show internal directories.
Click to hide internal directories.