docker

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MPL-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadDockerConfig

func LoadDockerConfig() (*configfile.ConfigFile, error)

Types

type Client

type Client struct {
	dockerclient.CommonAPIClient
}

Client is a client for docker

func NewClient

func NewClient(ctx context.Context, log log.Logger) (*Client, error)

NewClient creates a new docker client

type DockerBuilder added in v0.5.6

type DockerBuilder int

DockerBuilder represents the Docker builder types.

const (
	DockerBuilderDefault DockerBuilder = iota
	DockerBuilderBuildX
	DockerBuilderBuildKit
)

Enum values for DockerBuilder.

func DockerBuilderFromString added in v0.5.6

func DockerBuilderFromString(s string) (DockerBuilder, error)

func (DockerBuilder) String added in v0.5.6

func (db DockerBuilder) String() string

type DockerHelper

type DockerHelper struct {
	DockerCommand string
	// for a running container, we cannot pass down the container ID to the driver without introducing
	// changes in the driver interface (which we do not want to do). So, to get around this, we pass
	// it down to the driver during docker helper initialization.
	ContainerID string
	// allow command to have a custom environment
	Environment []string
	Builder     DockerBuilder
}

func (*DockerHelper) DeleteVolume added in v0.1.8

func (r *DockerHelper) DeleteVolume(ctx context.Context, volume string) error

func (*DockerHelper) FindContainer

func (r *DockerHelper) FindContainer(ctx context.Context, labels []string) ([]string, error)

FindContainer will try to find a container based on the input labels. If no container is found, it will search for the labels manually inspecting containers.

func (*DockerHelper) FindContainerByID added in v0.4.0

func (r *DockerHelper) FindContainerByID(ctx context.Context, containerIds []string) (*config.ContainerDetails, error)

func (*DockerHelper) FindContainerJSON added in v0.1.7

func (r *DockerHelper) FindContainerJSON(ctx context.Context, labels []string) ([]string, error)

FindContainerJSON will manually search for containers with matching labels. This is useful in case the `--filter` doesn't work.

func (*DockerHelper) FindDevContainer

func (r *DockerHelper) FindDevContainer(ctx context.Context, labels []string) (*config.ContainerDetails, error)

func (*DockerHelper) GPUSupportEnabled

func (r *DockerHelper) GPUSupportEnabled() (bool, error)

func (*DockerHelper) GetContainerLogs added in v0.5.5

func (r *DockerHelper) GetContainerLogs(ctx context.Context, id string, stdout io.Writer, stderr io.Writer) error

func (*DockerHelper) GetImageTag added in v0.5.5

func (r *DockerHelper) GetImageTag(ctx context.Context, imageID string) (string, error)

func (*DockerHelper) Inspect

func (r *DockerHelper) Inspect(ctx context.Context, ids []string, inspectType string, obj interface{}) error

func (*DockerHelper) InspectContainers

func (r *DockerHelper) InspectContainers(ctx context.Context, ids []string) ([]config.ContainerDetails, error)

func (*DockerHelper) InspectImage

func (r *DockerHelper) InspectImage(ctx context.Context, imageName string, tryRemote bool) (*config.ImageDetails, error)

func (*DockerHelper) IsNerdctl added in v0.5.6

func (r *DockerHelper) IsNerdctl() bool

func (*DockerHelper) IsPodman added in v0.1.7

func (r *DockerHelper) IsPodman() bool

func (*DockerHelper) Pull added in v0.5.5

func (r *DockerHelper) Pull(ctx context.Context, image string, stdin io.Reader, stdout io.Writer, stderr io.Writer) error

func (*DockerHelper) Remove

func (r *DockerHelper) Remove(ctx context.Context, id string) error

func (*DockerHelper) Run

func (r *DockerHelper) Run(ctx context.Context, args []string, stdin io.Reader, stdout io.Writer, stderr io.Writer) error

func (*DockerHelper) RunWithDir

func (r *DockerHelper) RunWithDir(ctx context.Context, dir string, args []string, stdin io.Reader, stdout io.Writer, stderr io.Writer) error

func (*DockerHelper) StartContainer

func (r *DockerHelper) StartContainer(ctx context.Context, containerId string) error

func (*DockerHelper) Stop

func (r *DockerHelper) Stop(ctx context.Context, id string) error

Jump to

Keyboard shortcuts

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