docker

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerConfigs

type ContainerConfigs struct {
	ContName   string
	Container  *container.Config
	Host       *container.HostConfig
	Networking *network.NetworkingConfig
}

type DockerClient

type DockerClient struct {
	// contains filtered or unexported fields
}

func NewDockerClient

func NewDockerClient(client *client.Client) DockerClient

func (*DockerClient) CreateNetwork

func (c *DockerClient) CreateNetwork(ctx context.Context, networkName string) (string, error)

Creates a network and returns the ID

func (*DockerClient) CtrExists

func (c *DockerClient) CtrExists(ctx context.Context, containerName string) (bool, string, error)

Checks if a container exists and returns (true, ID, nil) if it does

func (*DockerClient) ImageExists

func (c *DockerClient) ImageExists(ctx context.Context, image string) (bool, error)

func (*DockerClient) NetworkExists

func (c *DockerClient) NetworkExists(ctx context.Context, networkName string) (bool, string, error)

Checks if a network exists and returns (true, ID, nil) if it does

func (*DockerClient) Pull

func (c *DockerClient) Pull(ctx context.Context, image string) error

func (*DockerClient) RemoveCtr

func (c *DockerClient) RemoveCtr(ctx context.Context, containerName string) error

func (*DockerClient) RemoveNetwork

func (c *DockerClient) RemoveNetwork(ctx context.Context, networkName string) error

func (*DockerClient) RunAndWait

func (c *DockerClient) RunAndWait(ctx context.Context, conf ContainerConfigs) error

Creates and starts a container and then waits for it to exit

func (*DockerClient) RunAsync

func (c *DockerClient) RunAsync(ctx context.Context, conf ContainerConfigs) error

Creates and starts a container and returns without waiting

Jump to

Keyboard shortcuts

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