docker

package
v0.0.0-...-ac3b76c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 10, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerClient

type DockerClient struct {
	Client *client.Client
	Ctx    context.Context
}

func (*DockerClient) BatchContainerStop

func (d *DockerClient) BatchContainerStop(IDMap []string) (success []string, fail []string)

BatchContainerStop 批量停止容器

func (*DockerClient) ContainerCreate

func (d *DockerClient) ContainerCreate(
	options *container.Config,
	hostOptions *container.HostConfig,
	networkingOptions *network.NetworkingConfig,
	platform *specs.Platform,
	name string,
) (cont string, err error)

ContainerCreate 创建容器

func (*DockerClient) ContainerList

func (d *DockerClient) ContainerList() (containerList []types.Container, err error)

ContainerList 获取全部容器列表(含未运行)

func (*DockerClient) ContainerLogs

func (d *DockerClient) ContainerLogs(ID string) (string, error)

ContainerLogs 获取指定容器日志

func (*DockerClient) ContainerStart

func (d *DockerClient) ContainerStart(ID string) error

ContainerStart 启动指定容器

func (*DockerClient) ContainerStop

func (d *DockerClient) ContainerStop(ID string) error

ContainerStop 停止指定容器

func (*DockerClient) ContainerWait

func (d *DockerClient) ContainerWait(ID string) (code int, err error)

ContainerWait 监听容器状态

func (*DockerClient) ImageList

func (d *DockerClient) ImageList() (imageList []types.ImageSummary, err error)

ImageList 获取镜像列表

func (*DockerClient) ImagePull

func (d *DockerClient) ImagePull(refStr string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL