pkg

package
v0.0.0-...-84e9a83 Latest Latest
Warning

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

Go to latest
Published: May 27, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DockerEndpoint      = "unix:///var/run/docker.sock"
	DockerStartTimeout  = 30 * time.Second
	DockerDeleteTimeout = 5 * time.Second
)

Functions

This section is empty.

Types

type Docker

type Docker struct {
	Client *dockerClient.Client

	Context context.Context
	// contains filtered or unexported fields
}

func DockerClient

func DockerClient() (*Docker, error)

func NewDocker

func NewDocker(image, containerId, entryPoint string, context context.Context) (*Docker, error)

func (*Docker) CleanContainer

func (d *Docker) CleanContainer(id string)

清理容器

func (*Docker) CreateContainer

func (d *Docker) CreateContainer() (string, error)

创建容器

func (*Docker) PullImage

func (d *Docker) PullImage() error

拉取镜像

func (*Docker) RmContainer

func (d *Docker) RmContainer(id string, force bool) error

删除容器

func (*Docker) RunContainer

func (d *Docker) RunContainer() (string, error)

运行容器

func (*Docker) StartContainer

func (d *Docker) StartContainer(id string) error

启动容器

Jump to

Keyboard shortcuts

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