client

package
v1.2.23 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DockerSocket = "/var/run/docker.sock"

DockerSocket is a socket we use to connect to the Docker daemon

Functions

This section is empty.

Types

type DockerClient

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

DockerClient is a raw Docker client convenience wrapper

func New

func New(cnf *config.Config) (*DockerClient, error)

New creates new instance of DockerClient (our Docker client wrapper) Use DOCKER_HOST to set the URL to the Docker server. This depends on the operating system: for Linux unix:///var/run/docker.sock and for Windows npipe:////./pipe/docker_engine Use DOCKER_API_VERSION to set the version of the API to reach, leave empty for latest. API_VERSION is by default 1.27 (this may change) Use DOCKER_CERT_PATH to load the TLS certificates from. DOCKER_CERT_PATH/ca.pem DOCKER_CERT_PATH/cert.pem DOCKER_CERT_PATH/key.pem Use DOCKER_TLS_VERIFY to enable or disable TLS verification, off by default.

func (*DockerClient) Config

func (dc *DockerClient) Config() *config.Config

Config returns Docker client configuration

func (*DockerClient) ForceRemove

func (dc *DockerClient) ForceRemove(id string) error

ForceRemove kills & removes Docker container having the ID specified (like "docker rm -f")

func (*DockerClient) ListImagesForRepo

func (dc *DockerClient) ListImagesForRepo(repo string) ([]types.ImageSummary, error)

ListImagesForRepo lists images present locally for the repo specified

func (*DockerClient) Pull

func (dc *DockerClient) Pull(ref string) (io.ReadCloser, error)

Pull pulls Docker image specified

func (*DockerClient) Push

func (dc *DockerClient) Push(ref string) (io.ReadCloser, error)

Push pushes Docker image specified

func (*DockerClient) Run

func (dc *DockerClient) Run(ref, name string, portSpecs []string) (string, error)

Run runs Docker container from the image specified (like "docker run")

func (*DockerClient) Tag

func (dc *DockerClient) Tag(src, dst string) error

Tag puts a "dst" tag on "src" Docker image

Jump to

Keyboard shortcuts

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