Documentation ¶
Index ¶
- type DockerRuntime
- func (c *DockerRuntime) ContainerInspect(ctx context.Context, id string) (*types.GenericContainer, error)
- func (c *DockerRuntime) CreateContainer(ctx context.Context, node *types.Node) (err error)
- func (c *DockerRuntime) CreateNet(ctx context.Context) (err error)
- func (c *DockerRuntime) DeleteContainer(ctx context.Context, name string) error
- func (c *DockerRuntime) DeleteNet(ctx context.Context) (err error)
- func (c *DockerRuntime) Exec(ctx context.Context, id string, cmd []string) ([]byte, []byte, error)
- func (c *DockerRuntime) ExecNotWait(ctx context.Context, id string, cmd []string) error
- func (c *DockerRuntime) GetNSPath(ctx context.Context, containerId string) (string, error)
- func (c *DockerRuntime) ListContainers(ctx context.Context, labels []string) ([]types.GenericContainer, error)
- func (c *DockerRuntime) PullImageIfRequired(ctx context.Context, imageName string) error
- func (c *DockerRuntime) SetMgmtNet(n types.MgmtNet)
- func (c *DockerRuntime) StartContainer(ctx context.Context, id string) error
- func (c *DockerRuntime) StopContainer(context.Context, string, *time.Duration) error
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 NewDockerRuntime ¶
func NewDockerRuntime(d bool, dur time.Duration, gracefulShutdown bool) *DockerRuntime
func (*DockerRuntime) ContainerInspect ¶
func (c *DockerRuntime) ContainerInspect(ctx context.Context, id string) (*types.GenericContainer, error)
func (*DockerRuntime) CreateContainer ¶
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, name 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 ¶
Exec executes cmd on container identified with id and returns stdout, stderr bytes and an error
func (*DockerRuntime) ExecNotWait ¶
ExecNotWait executes cmd on container identified with id but doesn't wait for output nor attaches stodout/err
func (*DockerRuntime) GetNSPath ¶
GetNSPath inspects a container by its name/id and returns an netns path using the pid of a container
func (*DockerRuntime) ListContainers ¶
func (c *DockerRuntime) ListContainers(ctx context.Context, labels []string) ([]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) SetMgmtNet ¶
func (c *DockerRuntime) SetMgmtNet(n types.MgmtNet)
func (*DockerRuntime) StartContainer ¶
func (c *DockerRuntime) StartContainer(ctx context.Context, id string) error
StartContainer starts a docker container
func (*DockerRuntime) StopContainer ¶
Click to show internal directories.
Click to hide internal directories.