docker

package
v0.42.1 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2022 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrConnectToDockerDaemon   = "docker.connect_to_docker_daemon"
	ErrDockerPermissions       = "docker.docker_permissions"
	ErrImageDoesntExistLocally = "docker.image_doesnt_exist_locally"
	ErrImageInaccessible       = "docker.image_inaccessible"
)

Variables

View Source
var NoAuth string

Functions

func AWSAuthConfig

func AWSAuthConfig(awsClient *aws.Client) (string, error)

func CheckImageAccessible

func CheckImageAccessible(dockerClient *Client, dockerImage, authConfig string) error

func CheckImageExistsLocally added in v0.21.0

func CheckImageExistsLocally(dockerClient *Client, dockerImage string) error

func CopyFromContainer added in v0.20.0

func CopyFromContainer(containerID string, containerPath string, localDir string) error

The file or directory name of containerPath will be preserved in localDir For example, if the container has /aaa/zzz.txt,

  • CopyFromContainer(_, "/aaa", "~/test") will create "~/test/aaa/zzz.txt"
  • CopyFromContainer(_, "/aaa/zzz.txt", "~/test") will create "~/test/zzz.txt"

func CopyToContainer added in v0.20.0

func CopyToContainer(containerID string, input *archive.Input, containerPath string) error

The provided input will be extracted into the container's containerPath directory

func EncodeAuthConfig

func EncodeAuthConfig(authConfig dockertypes.AuthConfig) (string, error)

func ErrorConnectToDockerDaemon

func ErrorConnectToDockerDaemon() error

func ErrorDockerPermissions

func ErrorDockerPermissions(err error) error

func ErrorImageDoesntExistLocally added in v0.21.0

func ErrorImageDoesntExistLocally(image string) error

func ErrorImageInaccessible

func ErrorImageInaccessible(image string, cause error) error

func ExtractImageTag added in v0.18.0

func ExtractImageTag(dockerImage string) string

func PullImage

func PullImage(image string, encodedAuthConfig string, pullVerbosity PullVerbosity) (bool, error)

func StreamDockerLogs

func StreamDockerLogs(containerID string, containerIDs ...string) error

func StreamDockerLogsFn

func StreamDockerLogsFn(containerID string, dockerClient *Client) func() error

func WrapDockerError

func WrapDockerError(err error) error

Types

type Client

type Client struct {
	*dockerclient.Client
	Info dockertypes.Info
}

func GetDockerClient

func GetDockerClient() (*Client, error)

func MustDockerClient

func MustDockerClient() *Client

type PullVerbosity

type PullVerbosity int
const (
	NoPrint PullVerbosity = iota
	PrintDots
	PrintProgressBars
)

Jump to

Keyboard shortcuts

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