docker

package
v0.0.0-...-b40633b Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientConfig

type ClientConfig struct {
	// contains filtered or unexported fields
}

ClientConfig docker client config

func NewClientConfig

func NewClientConfig(endpoint, cert, key, ca, apiVersion string) *ClientConfig

NewClientConfig create docker client config

type CreateContainerOptions

type CreateContainerOptions struct {
	Config        *container.Config
	HostConfig    *container.HostConfig
	NetworkConfig *network.NetworkingConfig
	Name          string
}

CreateContainerOptions create container options

type Docker

type Docker struct {
	*client.Client
}

Docker docker client

var Client *Docker

Client docker client

func NewDocker

func NewDocker(config *ClientConfig) *Docker

NewDocker create new docker client

func (*Docker) AttachExecContainer

func (d *Docker) AttachExecContainer(id, cmd string) error

AttachExecContainer attach container

func (*Docker) CommitContainer

func (d *Docker) CommitContainer(name string, opt types.ContainerCommitOptions) error

CommitContainer commit container

func (*Docker) ContainerLogStream

func (d *Docker) ContainerLogStream(name string) (io.ReadCloser, error)

ContainerLogStream returns the logs generated by a container in an io.ReadCloser.

func (*Docker) Containers

func (d *Docker) Containers(opt types.ContainerListOptions) ([]types.Container, error)

Containers get containers

func (*Docker) CreateContainer

func (d *Docker) CreateContainer(opt CreateContainerOptions) error

CreateContainer create container

func (*Docker) CreateExec

func (d *Docker) CreateExec(container, cmd string) (types.IDResponse, error)

CreateExec container exec create

func (*Docker) CreateVolume

func (d *Docker) CreateVolume(opt volumetypes.VolumeCreateBody) error

CreateVolume create volume

func (*Docker) ExportContainer

func (d *Docker) ExportContainer(name, path string) error

ExportContainer export container

func (*Docker) Images

func (d *Docker) Images(opt types.ImageListOptions) ([]types.ImageSummary, error)

Images get images from

func (*Docker) ImportImage

func (d *Docker) ImportImage(name, tag, path string) error

ImportImage import image

func (*Docker) InspectContainer

func (d *Docker) InspectContainer(name string) (types.ContainerJSON, error)

InspectContainer inspect container

func (*Docker) InspectImage

func (d *Docker) InspectImage(name string) (types.ImageInspect, error)

InspectImage inspect image

func (*Docker) InspectNetwork

func (d *Docker) InspectNetwork(name string) (types.NetworkResource, error)

InspectNetwork inspect network

func (*Docker) InspectVolume

func (d *Docker) InspectVolume(name string) (types.Volume, error)

InspectVolume inspect volume

func (*Docker) KillContainer

func (d *Docker) KillContainer(name string) error

KillContainer kill container

func (*Docker) LoadImage

func (d *Docker) LoadImage(path string) error

LoadImage load image from tar file

func (*Docker) Networks

func (d *Docker) Networks(opt types.NetworkListOptions) ([]types.NetworkResource, error)

Networks get networks

func (*Docker) NewContainerOptions

func (d *Docker) NewContainerOptions(config map[string]string, isAttach bool) (CreateContainerOptions, error)

NewContainerOptions generate container options to create container

func (*Docker) NewCreateVolumeOptions

func (d *Docker) NewCreateVolumeOptions(data map[string]string) volumetypes.VolumeCreateBody

NewCreateVolumeOptions generate options to create volume

func (*Docker) PruneVolumes

func (d *Docker) PruneVolumes() error

PruneVolumes remove unused volume

func (*Docker) PullImage

func (d *Docker) PullImage(name string) error

PullImage pull image

func (*Docker) RemoveContainer

func (d *Docker) RemoveContainer(name string) error

RemoveContainer remove container

func (*Docker) RemoveDanglingImages

func (d *Docker) RemoveDanglingImages() error

RemoveDanglingImages remove dangling images

func (*Docker) RemoveImage

func (d *Docker) RemoveImage(name string) error

RemoveImage remove image

func (*Docker) RemoveNetwork

func (d *Docker) RemoveNetwork(name string) error

RemoveNetwork remove network

func (*Docker) RemoveVolume

func (d *Docker) RemoveVolume(name string) error

RemoveVolume remove volume

func (*Docker) RenameContainer

func (d *Docker) RenameContainer(id, newName string) error

RenameContainer rename container

func (*Docker) SaveImage

func (d *Docker) SaveImage(ids []string, path string) error

SaveImage save image to tar file

func (*Docker) SearchImage

func (d *Docker) SearchImage(name string) ([]registry.SearchResult, error)

SearchImage search images

func (*Docker) StartContainer

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

StartContainer start container with id

func (*Docker) StopContainer

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

StopContainer stop container with id

func (*Docker) Volumes

func (d *Docker) Volumes() ([]*types.Volume, error)

Volumes get volumes

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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