docker

package
v0.0.0-0.15.3 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2021 License: BSD-3-Clause Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerRuntime

type DockerRuntime struct {
	Client *dockerC.Client
	Mgmt   *types.MgmtNet
	// contains filtered or unexported fields
}

func (*DockerRuntime) Config added in v0.15.0

func (c *DockerRuntime) Config() runtime.RuntimeConfig

func (*DockerRuntime) CreateContainer

func (c *DockerRuntime) CreateContainer(ctx context.Context, node *types.NodeConfig) (interface{}, error)

CreateContainer creates a docker container

func (*DockerRuntime) CreateNet

func (c *DockerRuntime) CreateNet(ctx context.Context) (err error)

CreateDockerNet creates a docker network or reusing if it exists

func (*DockerRuntime) DeleteContainer

func (c *DockerRuntime) DeleteContainer(ctx context.Context, containerID string) error

DeleteContainer tries to stop a container then remove it

func (*DockerRuntime) DeleteNet

func (c *DockerRuntime) DeleteNet(ctx context.Context) (err error)

DeleteNet deletes a docker bridge

func (*DockerRuntime) Exec

func (c *DockerRuntime) Exec(ctx context.Context, id string, cmd []string) ([]byte, []byte, error)

Exec executes cmd on container identified with id and returns stdout, stderr bytes and an error

func (*DockerRuntime) ExecNotWait

func (c *DockerRuntime) ExecNotWait(ctx context.Context, id string, cmd []string) error

ExecNotWait executes cmd on container identified with id but doesn't wait for output nor attaches stodout/err

func (*DockerRuntime) GetContainer added in v0.15.0

func (c *DockerRuntime) GetContainer(ctx context.Context, containerID string) (*types.GenericContainer, error)

func (*DockerRuntime) GetNSPath

func (c *DockerRuntime) GetNSPath(ctx context.Context, containerId string) (string, error)

GetNSPath inspects a container by its name/id and returns an netns path using the pid of a container

func (*DockerRuntime) GetName added in v0.15.0

func (c *DockerRuntime) GetName() string

func (*DockerRuntime) Init added in v0.15.0

func (c *DockerRuntime) Init(opts ...runtime.RuntimeOption) error

func (*DockerRuntime) ListContainers

func (c *DockerRuntime) ListContainers(ctx context.Context, gfilters []*types.GenericFilter) ([]types.GenericContainer, error)

ListContainers lists all containers with labels []string

func (*DockerRuntime) PullImageIfRequired

func (c *DockerRuntime) PullImageIfRequired(ctx context.Context, imageName string) error

func (*DockerRuntime) StartContainer

func (c *DockerRuntime) StartContainer(ctx context.Context, id string) error

StartContainer starts a docker container

func (*DockerRuntime) StopContainer

func (c *DockerRuntime) StopContainer(ctx context.Context, name string) error

func (*DockerRuntime) WithConfig added in v0.15.0

func (c *DockerRuntime) WithConfig(cfg *runtime.RuntimeConfig)

func (*DockerRuntime) WithKeepMgmtNet added in v0.15.0

func (c *DockerRuntime) WithKeepMgmtNet()

func (*DockerRuntime) WithMgmtNet added in v0.15.0

func (c *DockerRuntime) WithMgmtNet(n *types.MgmtNet)

Jump to

Keyboard shortcuts

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