docker_utils

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildCompleteDockerImage

func BuildCompleteDockerImage(imageName, imageTag string) string

BuildCompleteDockerImage - Build the complete Docker image name from name and tag

func CheckDockerDaemon

func CheckDockerDaemon(cli DockerClient, ctx *context.Context) error

CheckDockerDaemon - Check wheather the Docker daemon is running, if the method starts it

func CheckDockerDaemonRunning

func CheckDockerDaemonRunning(cli DockerClient, ctx *context.Context) bool

CheckDockerDaemonRunning - Check wheather the Docker daemon is running (making a simple request)

func EncodeRegistryAuth

func EncodeRegistryAuth(username, password string) string

EncodeRegistryAuth -- take username and password and create a string to be passed as RegistryAuth parameter

func NormalizeImageName

func NormalizeImageName(imageName string) (string, error)

NormalizeImageName - Normalize Docker image names to canonical WARN: Normalizing a Docker image reference in the form name:tag will output always name:latest

func ParseDockerImageName

func ParseDockerImageName(imageRef string) string

ParseDockerImageName - Retrieve Docker image name from a string

func ParseDockerImageNameAndTag

func ParseDockerImageNameAndTag(imageRef string) (dockerImageName, dockerImageTag string)

ParseDockerImageNameAndTag - Retrieve Docker image name and tag from a string

func ParseDockerImageTag

func ParseDockerImageTag(imageRef string) string

ParseDockerImageTag - Retrieve Docker image tag from a string

func PullDockerImage

func PullDockerImage(cli DockerClient, ctx *context.Context,
	imageName, imageTag string, options *types.ImagePullOptions, normalize bool) error

PullDockerImage - Pull Docker image

func PushDockerImage

func PushDockerImage(cli DockerClient, ctx *context.Context,
	imageName, imageTag string, options *types.ImagePushOptions) error

PushDockerImage - Push Docker image to Docker registry

func StartDockerDaemon

func StartDockerDaemon(cli DockerClient, ctx *context.Context) error

StartDockerDaemon - Start up the Docker deamon based on the current OS

func TagDockerImage

func TagDockerImage(cli DockerClient, ctx *context.Context,
	imageName, imageTag, imageNameNew, imageTagNew string) error

TagDockerImage - Tag Docker image

Types

type DockerClient

type DockerClient interface {
	ContainerList(ctx context.Context, options types.ContainerListOptions) ([]types.Container, error)
	ImagePull(ctx context.Context, refStr string, options types.ImagePullOptions) (io.ReadCloser, error)
	ImagePush(ctx context.Context, image string, options types.ImagePushOptions) (io.ReadCloser, error)
	ImageTag(ctx context.Context, source, target string) error
	Close() error
}

DockerClient - interface for all functionality required from the docker client

func OpenDockerClient

func OpenDockerClient() (DockerClient, error)

OpenDockerClient - Create new Docker client

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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