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 ¶
- type Engine
- func (e *Engine) AreMicroserviceAndContainerEqual(containerID string, ms *models.Microservice, _ *models.Registry) bool
- func (e *Engine) Close() error
- func (e *Engine) CreateContainer(ms *models.Microservice, hostname string) (string, error)
- func (e *Engine) CreateExecSession(containerID string, runtimeExecID string, cmd []string) (string, error)
- func (e *Engine) DeleteImage(_ context.Context, nameOrID string) error
- func (e *Engine) EnsureNetwork(_ string) error
- func (e *Engine) FindLocalImage(imageRef, _ string, _ bool) (bool, error)
- func (e *Engine) GetAllContainers() ([]engine.Container, error)
- func (e *Engine) GetContainer(microserviceUUID string) (*engine.Container, error)
- func (e *Engine) GetContainerByID(containerID string) (*engine.Container, error)
- func (e *Engine) GetContainerIPAddress(containerID string) (string, error)
- func (e *Engine) GetContainerMicroserviceUUID(cont engine.Container) string
- func (e *Engine) GetContainerName(cont engine.Container) string
- func (e *Engine) GetContainerSandboxID(_ string) (string, error)
- func (e *Engine) GetContainerStartedAt(containerID string) (int64, error)
- func (e *Engine) GetContainerStats(containerID string) (*engine.ContainerStats, error)
- func (e *Engine) GetContainerStatus(containerID, microserviceUUID string) (*models.MicroserviceStatus, error)
- func (e *Engine) GetExecSessionExitCode(execID string) (int, error)
- func (e *Engine) GetExecSessionStatus(execID string) (bool, error)
- func (e *Engine) GetRunningContainers() ([]engine.Container, error)
- func (e *Engine) Init(cfg engine.EngineConfig) error
- func (e *Engine) InspectContainerRaw(containerID string) (map[string]any, error)
- func (e *Engine) KillContainer(containerID string) error
- func (e *Engine) ListImages(_ context.Context) ([]engine.ImageInfo, error)
- func (e *Engine) LoadImageFromPath(_ context.Context, archivePath string) ([]engine.LoadedImage, error)
- func (e *Engine) PruneContainers(_ context.Context) (*engine.ContainerPruneReport, error)
- func (e *Engine) PruneDangling(_ context.Context) (*engine.ImagePruneReport, error)
- func (e *Engine) PruneImages() error
- func (e *Engine) PruneVolumes(_ context.Context) (*engine.VolumePruneReport, error)
- func (e *Engine) PullImage(imageRef string, registry *models.Registry, opts *engine.PullImageOptions) error
- func (e *Engine) RemoveContainer(containerID string, removeVolumes bool) error
- func (e *Engine) RemoveImage(imageRef string) error
- func (e *Engine) RemoveNamedVolume(_ context.Context, name string) error
- func (e *Engine) ResizeExecSession(execID string, cols, rows uint32) error
- func (e *Engine) StartContainer(containerID string) error
- func (e *Engine) StartExecSession(execID string, stdin io.Reader, stdout, stderr io.Writer) error
- func (e *Engine) StopContainer(containerID string) error
- func (e *Engine) StopExecSession(execID string) error
- func (e *Engine) TailContainerLogs(containerID, sessionID, microserviceUUID string, handler engine.LogTailHandler, ...) error
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 (*Engine) AreMicroserviceAndContainerEqual ¶
func (*Engine) CreateContainer ¶
func (*Engine) CreateExecSession ¶
func (*Engine) EnsureNetwork ¶
func (*Engine) FindLocalImage ¶
func (*Engine) GetContainer ¶
func (*Engine) GetContainerByID ¶
func (*Engine) GetContainerIPAddress ¶
func (*Engine) GetContainerMicroserviceUUID ¶
func (*Engine) GetContainerSandboxID ¶
func (*Engine) GetContainerStartedAt ¶
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 (*Engine) GetExecSessionStatus ¶
GetExecSessionStatus reports whether the Docker exec process is still running.
func (*Engine) GetRunningContainers ¶
func (*Engine) Init ¶
func (e *Engine) Init(cfg engine.EngineConfig) error
Init dials the Docker daemon socket.
func (*Engine) InspectContainerRaw ¶
func (*Engine) KillContainer ¶
func (*Engine) ListImages ¶
func (*Engine) LoadImageFromPath ¶
func (*Engine) PruneContainers ¶
func (*Engine) PruneDangling ¶
PruneDangling removes only untagged images not referenced by any container.
func (*Engine) PruneImages ¶
func (*Engine) PruneVolumes ¶
func (*Engine) RemoveContainer ¶
func (*Engine) RemoveImage ¶
func (*Engine) RemoveNamedVolume ¶
func (*Engine) ResizeExecSession ¶
func (*Engine) StartContainer ¶
func (*Engine) StartExecSession ¶
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 (*Engine) StopExecSession ¶
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