runtime

package
v0.0.0-...-50afbbb Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 21 Imported by: 1

Documentation

Index

Constants

View Source
const CONTAINER_NAME_PREFIX = "klt"
View Source
const DOCKER_UNIX_SOCKET = "unix:///var/run/docker.sock"

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerRunner

type ContainerRunner struct {
	Client     DockerApiClient
	VolumesEnv *volumes.Env
	RandEnv    *rand.Rand
}

func GetDefaultRunner

func GetDefaultRunner(osCommandRunner OsCommandRunner, metadataProvider metadata.Provider) (*ContainerRunner, error)

func (ContainerRunner) RunContainer

func (runner ContainerRunner) RunContainer(auth string, spec api.ContainerSpecStruct, detach bool) error

type DockerApiClient

type DockerApiClient interface {
	ImagePull(ctx context.Context, ref string, options dockertypes.ImagePullOptions) (io.ReadCloser, error)
	ContainerCreate(ctx context.Context, config *dockercontainer.Config, hostConfig *dockercontainer.HostConfig, networkingConfig *dockernetwork.NetworkingConfig, containerName string) (dockertypes.ContainerCreateResponse, error)
	ContainerStart(ctx context.Context, container string) error
	ContainerList(ctx context.Context, opts dockertypes.ContainerListOptions) ([]dockertypes.Container, error)
	ContainerRemove(ctx context.Context, containerID string, opts dockertypes.ContainerRemoveOptions) error
}

type OsCommandRunner

type OsCommandRunner interface {
	Run(...string) (string, error)
	MkdirAll(path string, perm os.FileMode) error
	Stat(name string) (os.FileInfo, error)
}

Jump to

Keyboard shortcuts

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