docker

package
v1.1.0-rc.5 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: EPL-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package docker implements the ContainerEngine interface backed by the Docker daemon. It wraps the existing pkg/docker client so all Docker-specific logic stays there; this layer only adapts types to the engine-agnostic interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

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

Engine implements engine.ContainerEngine using the Docker daemon.

func New

func New() *Engine

New returns a new Docker engine. Call Init() before use.

func (*Engine) AreMicroserviceAndContainerEqual

func (e *Engine) AreMicroserviceAndContainerEqual(containerID string, ms *models.Microservice, _ *models.Registry) bool

func (*Engine) Close

func (e *Engine) Close() error

Close releases the Docker client.

func (*Engine) CreateContainer

func (e *Engine) CreateContainer(ms *models.Microservice, hostname string) (string, error)

func (*Engine) CreateExecSession

func (e *Engine) CreateExecSession(containerID string, runtimeExecID string, cmd []string) (string, error)

func (*Engine) DeleteImage

func (e *Engine) DeleteImage(_ context.Context, nameOrID string) error

func (*Engine) EnsureNetwork

func (e *Engine) EnsureNetwork(_ string) error

func (*Engine) FindLocalImage

func (e *Engine) FindLocalImage(imageRef, _ string, _ bool) (bool, error)

func (*Engine) GetAllContainers

func (e *Engine) GetAllContainers() ([]engine.Container, error)

func (*Engine) GetContainer

func (e *Engine) GetContainer(microserviceUUID string) (*engine.Container, error)

func (*Engine) GetContainerByID

func (e *Engine) GetContainerByID(containerID string) (*engine.Container, error)

func (*Engine) GetContainerIPAddress

func (e *Engine) GetContainerIPAddress(containerID string) (string, error)

func (*Engine) GetContainerMicroserviceUUID

func (e *Engine) GetContainerMicroserviceUUID(cont engine.Container) string

func (*Engine) GetContainerName

func (e *Engine) GetContainerName(cont engine.Container) string

func (*Engine) GetContainerSandboxID

func (e *Engine) GetContainerSandboxID(_ string) (string, error)

func (*Engine) GetContainerStartedAt

func (e *Engine) GetContainerStartedAt(containerID string) (int64, error)

func (*Engine) GetContainerStats

func (e *Engine) GetContainerStats(containerID string) (*engine.ContainerStats, error)

func (*Engine) GetContainerStatus

func (e *Engine) GetContainerStatus(containerID, microserviceUUID string) (*models.MicroserviceStatus, error)

func (*Engine) GetExecSessionExitCode

func (e *Engine) GetExecSessionExitCode(execID string) (int, error)

func (*Engine) GetExecSessionStatus

func (e *Engine) GetExecSessionStatus(execID string) (bool, error)

GetExecSessionStatus reports whether the Docker exec process is still running.

func (*Engine) GetRunningContainers

func (e *Engine) GetRunningContainers() ([]engine.Container, error)

func (*Engine) Init

func (e *Engine) Init(cfg engine.EngineConfig) error

Init dials the Docker daemon socket.

func (*Engine) InspectContainerRaw

func (e *Engine) InspectContainerRaw(containerID string) (map[string]any, error)

func (*Engine) KillContainer

func (e *Engine) KillContainer(containerID string) error

func (*Engine) ListImages

func (e *Engine) ListImages(_ context.Context) ([]engine.ImageInfo, error)

func (*Engine) LoadImageFromPath

func (e *Engine) LoadImageFromPath(_ context.Context, archivePath string) ([]engine.LoadedImage, error)

func (*Engine) PruneContainers

func (e *Engine) PruneContainers(_ context.Context) (*engine.ContainerPruneReport, error)

func (*Engine) PruneDangling

func (e *Engine) PruneDangling(_ context.Context) (*engine.ImagePruneReport, error)

PruneDangling removes only untagged images not referenced by any container.

func (*Engine) PruneImages

func (e *Engine) PruneImages() error

func (*Engine) PruneVolumes

func (e *Engine) PruneVolumes(_ context.Context) (*engine.VolumePruneReport, error)

func (*Engine) PullImage

func (e *Engine) PullImage(imageRef string, registry *models.Registry, opts *engine.PullImageOptions) error

func (*Engine) RemoveContainer

func (e *Engine) RemoveContainer(containerID string, removeVolumes bool) error

func (*Engine) RemoveImage

func (e *Engine) RemoveImage(imageRef string) error

func (*Engine) RemoveNamedVolume

func (e *Engine) RemoveNamedVolume(_ context.Context, name string) error

func (*Engine) ResizeExecSession

func (e *Engine) ResizeExecSession(execID string, cols, rows uint32) error

func (*Engine) StartContainer

func (e *Engine) StartContainer(containerID string) error

func (*Engine) StartExecSession

func (e *Engine) StartExecSession(execID string, stdin io.Reader, stdout, stderr io.Writer) error

StartExecSession attaches stdin/stdout/stderr to a previously created Docker exec session and starts it. The call blocks until the process exits or an error occurs.

func (*Engine) StopContainer

func (e *Engine) StopContainer(containerID string) error

func (*Engine) StopExecSession

func (e *Engine) StopExecSession(execID string) error

StopExecSession best-effort stops a Docker exec session.

func (*Engine) TailContainerLogs

func (e *Engine) TailContainerLogs(containerID, sessionID, microserviceUUID string, handler engine.LogTailHandler, cfg *engine.TailConfig) error

Jump to

Keyboard shortcuts

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