docker

package
v0.0.0-...-b274fa0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerRunner

type DockerRunner struct {
	NodeDir   string
	Image     string
	IP        string
	DockerAPI *client.Client
	// contains filtered or unexported fields
}

func NewDockerRunner

func NewDockerRunner(binary, nodeDir string, api *client.Client, image, ip string, command runner.Command, config runner.Config) (*DockerRunner, error)

NewDockerRunner creates a Docker-based runner for the given command. If ip is nonempty, it will be assigned as a static IP. The command should specify a docker network that already exists to be used for communication with other docker-based runners.

func (*DockerRunner) Command

func (d *DockerRunner) Command() runner.Command

func (*DockerRunner) Start

func (d *DockerRunner) Start(ctx context.Context) (*harness, error)

Start a new docker container based on the runner config. Any existing container with the same name will be removed first. Return IP of new container or error.

Jump to

Keyboard shortcuts

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