docker

package
v0.0.0-...-3776344 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerConfig

type ContainerConfig struct {
	Image         string
	ContainerName string
	Cmd           []string
	HostPort      string
	ContainerPort string
	AppDir        string
	EnvVars       map[string]string
	Binds         []string
	NetworkName   string
}

ContainerConfig holds the configuration for creating a runtime container.

type ImagePullProgress

type ImagePullProgress struct {
	ID       string
	Status   string
	Progress string
	Error    string
}

ImagePullProgress reports progress of a Docker image pull operation.

type LogStreamOptions

type LogStreamOptions struct {
	Follow     bool
	Tail       string // "all" or a number like "100"
	Since      string // RFC3339 timestamp or relative duration
	Timestamps bool
}

LogStreamOptions configures container log streaming with filtering support.

type RuntimeContainer

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

RuntimeContainer implements RuntimeContainerManager using the Docker Engine API.

func NewRuntimeContainer

func NewRuntimeContainer(logger *zap.Logger) (*RuntimeContainer, error)

NewRuntimeContainer creates a new Docker client for managing runtime containers.

func (*RuntimeContainer) CheckAvailability

func (rc *RuntimeContainer) CheckAvailability(ctx context.Context) error

func (*RuntimeContainer) CleanupStale

func (rc *RuntimeContainer) CleanupStale(
	ctx context.Context,
	containerName string,
) error

func (*RuntimeContainer) CreateAndStart

func (rc *RuntimeContainer) CreateAndStart(
	ctx context.Context,
	cfg *ContainerConfig,
) (string, error)

func (*RuntimeContainer) EnsureImage

func (rc *RuntimeContainer) EnsureImage(
	ctx context.Context,
	img string,
	progress chan<- ImagePullProgress,
) error

func (*RuntimeContainer) IsRunning

func (rc *RuntimeContainer) IsRunning(ctx context.Context, containerID string) (bool, error)

func (*RuntimeContainer) RestartContainer

func (rc *RuntimeContainer) RestartContainer(
	ctx context.Context,
	containerID string,
) error

func (*RuntimeContainer) Stop

func (rc *RuntimeContainer) Stop(ctx context.Context, containerID string) error

func (*RuntimeContainer) StreamLogs

func (rc *RuntimeContainer) StreamLogs(
	ctx context.Context,
	containerID string,
) (io.ReadCloser, error)

func (*RuntimeContainer) StreamLogsWithOptions

func (rc *RuntimeContainer) StreamLogsWithOptions(
	ctx context.Context,
	containerID string,
	opts LogStreamOptions,
) (io.ReadCloser, error)

type RuntimeContainerManager

type RuntimeContainerManager interface {
	CheckAvailability(ctx context.Context) error
	EnsureImage(ctx context.Context, image string, progress chan<- ImagePullProgress) error
	CreateAndStart(ctx context.Context, config *ContainerConfig) (string, error)
	StreamLogs(ctx context.Context, containerID string) (io.ReadCloser, error)
	StreamLogsWithOptions(ctx context.Context, containerID string, opts LogStreamOptions) (io.ReadCloser, error)
	RestartContainer(ctx context.Context, containerID string) error
	Stop(ctx context.Context, containerID string) error
	IsRunning(ctx context.Context, containerID string) (bool, error)
	CleanupStale(ctx context.Context, containerName string) error
}

RuntimeContainerManager manages Docker containers for the Celerity dev runtime.

Jump to

Keyboard shortcuts

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