docker

package
v0.90.1-rc.2 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package docker implements helper function for docker cli

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerOptions

type DockerOptions struct{}

DockerOptions implements the DockerWrapper interface by using `docker` binary internally

func (*DockerOptions) BuildImage

func (do *DockerOptions) BuildImage(image, template, dirPath string) error

BuildImage invokes `docker build -t <image> -f <template> <dirpath>` command

func (*DockerOptions) LoadImage

func (do *DockerOptions) LoadImage(archiveFile string) error

LoadImage invokes `docker load -i <architefile>` command

func (*DockerOptions) PushImage

func (do *DockerOptions) PushImage(image string) error

PushImage invokes `docker push <image>` command

func (*DockerOptions) SaveImage

func (do *DockerOptions) SaveImage(image, archiveFile string) error

SaveImage invokes `docker save <image> | gzip -c > <archivefile>` command

func (*DockerOptions) TagImage

func (do *DockerOptions) TagImage(existingImage, newImage string) error

TagImage invokes `docker tag <existingImage> <newImage>` command

type DockerWrapper

type DockerWrapper interface {
	// BuildImage invokes `docker build -t <image> -f <template> <dirpath>` command
	BuildImage(image, template, dirPath string) error
	// SaveImage invokes `docker save <image> | gzip -c > <archivefile>` command
	SaveImage(image, archiveFile string) error
	// LoadImage invokes `docker load -i <architefile>` command
	LoadImage(archiveFile string) error
	// TagImage invokes `docker tag <existingImage> <newImage>` command
	TagImage(existingImage, newImage string) error
	// PushImage invokes `docker push <image>` command
	PushImage(image string) error
}

DockerWrapper defines the docker command wrapper functions

func NewDockerCLIWrapper

func NewDockerCLIWrapper() DockerWrapper

NewDockerCLIWrapper creates new DockerWrapper instance

Jump to

Keyboard shortcuts

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