docker

package
v0.0.0-...-31ed48f Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrImageNotFound = errors.New("image not found on Docker host")

Functions

func Pull

func Pull(dockerClient Client, image string, repositoryURI string, stripTag bool, auth ecr.RegistryAuth) (err error)

Pull will pull the image from ECR to the Docker host using the 'repositoryURI' and the tag from the 'image'. The 'stripTag' parameter will optionally tag the pulled image as the simpler 'image', and remove the full ECR image tag from the Docker host.

func TagAndPush

func TagAndPush(dockerClient Client, image string, repositoryURI string, auth ecr.RegistryAuth) (err error)

TagAndPush will tag the image using the 'repositoryURI' and tag in the 'image' on the Docker host, then push the image to ECR. The tagged image is always cleaned up, even if pushing the image fails.

Types

type Client

type Client interface {
	ImageExists(image string) error
	ImagePush(image string, auth ecr.RegistryAuth) error
	ImagePull(image string, auth ecr.RegistryAuth) error
	ImageTag(source string, target string) error
	ImageRemove(image string) error
}

func NewClient

func NewClient() (Client, error)

NewClient creates a new Docker client and logger to interact with the Docker API

Jump to

Keyboard shortcuts

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