container

package
v0.2.21 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2021 License: MIT Imports: 33 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteImage added in v0.2.21

func DeleteImage(ctx context.Context, imageName string) (bool, error)

DeleteImage removes image from local store, the function is used to run different container image architectures

func GetDockerClient added in v0.2.9

func GetDockerClient(ctx context.Context) (*client.Client, error)

func ImageExistsLocally

func ImageExistsLocally(ctx context.Context, imageName string, platform string) (bool, error)

ImageExistsLocally returns a boolean indicating if an image with the requested name, tag and architecture exists in the local docker image store

func NewDockerBuildExecutor

func NewDockerBuildExecutor(input NewDockerBuildExecutorInput) common.Executor

NewDockerBuildExecutor function to create a run executor for the container

func NewDockerPullExecutor

func NewDockerPullExecutor(input NewDockerPullExecutorInput) common.Executor

NewDockerPullExecutor function to create a run executor for the container

func NewDockerVolumeRemoveExecutor added in v0.2.2

func NewDockerVolumeRemoveExecutor(volume string, force bool) common.Executor

Types

type Container added in v0.2.2

type Container interface {
	Create() common.Executor
	Copy(destPath string, files ...*FileEntry) common.Executor
	CopyDir(destPath string, srcPath string) common.Executor
	Pull(forcePull bool) common.Executor
	Start(attach bool) common.Executor
	Exec(command []string, env map[string]string) common.Executor
	UpdateFromGithubEnv(env *map[string]string) common.Executor
	Remove() common.Executor
}

Container for managing docker run containers

func NewContainer added in v0.2.2

func NewContainer(input *NewContainerInput) Container

NewContainer creates a reference to a container

type FileEntry added in v0.2.2

type FileEntry struct {
	Name string
	Mode int64
	Body string
}

FileEntry is a file to copy to a container

type NewContainerInput added in v0.2.2

type NewContainerInput struct {
	Image       string
	Entrypoint  []string
	Cmd         []string
	WorkingDir  string
	Env         []string
	Binds       []string
	Mounts      map[string]string
	Name        string
	Stdout      io.Writer
	Stderr      io.Writer
	NetworkMode string
	Privileged  bool
	UsernsMode  string
	Platform    string
}

NewContainerInput the input for the New function

type NewDockerBuildExecutorInput

type NewDockerBuildExecutorInput struct {
	ContextDir string
	ImageTag   string
	Platform   string
}

NewDockerBuildExecutorInput the input for the NewDockerBuildExecutor function

type NewDockerPullExecutorInput

type NewDockerPullExecutorInput struct {
	Image     string
	ForcePull bool
	Platform  string
}

NewDockerPullExecutorInput the input for the NewDockerPullExecutor function

Jump to

Keyboard shortcuts

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