docker

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ContainerJobPath = "/manfred-job"

ContainerJobPath is where the job directory is mounted inside containers.

Variables

This section is empty.

Functions

func ContainerName

func ContainerName(projectName, service string) string

ContainerName returns the container name for a compose project and service.

Types

type Client

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

Client wraps Docker SDK operations.

func New

func New() (*Client, error)

New creates a new Docker client.

func (*Client) Close

func (c *Client) Close() error

Close closes the Docker client connection.

func (*Client) ComposeDown

func (c *Client) ComposeDown(ctx context.Context, composeFile, projectName string) error

ComposeDown stops and removes containers.

func (*Client) ComposeUp

func (c *Client) ComposeUp(ctx context.Context, opts ComposeOptions) error

ComposeUp starts containers using docker compose. We use exec because the Docker SDK doesn't have native compose support.

func (*Client) DebugContainers

func (c *Client) DebugContainers(ctx context.Context, projectName string, out io.Writer)

DebugContainers shows container information for debugging.

func (*Client) Exec

func (c *Client) Exec(ctx context.Context, containerName string, command []string, opts ExecOptions) error

Exec runs a command in a container and streams output.

func (*Client) ExecCapture

func (c *Client) ExecCapture(ctx context.Context, containerName string, command []string) (string, error)

ExecCapture runs a command and returns its output.

func (*Client) ExecCaptureWithError

func (c *Client) ExecCaptureWithError(ctx context.Context, containerName string, command []string) (string, error)

ExecCaptureWithError runs a command and returns output and error details.

func (*Client) ExecSilent

func (c *Client) ExecSilent(ctx context.Context, containerName string, command []string) bool

ExecSilent runs a command and returns success/failure.

func (*Client) IsRunning

func (c *Client) IsRunning(ctx context.Context, containerName string) (bool, error)

IsRunning checks if a container is running.

func (c *Client) SetupCredentialSymlinks(ctx context.Context, containerName string) error

SetupCredentialSymlinks creates symlinks for Claude credentials inside a container.

func (*Client) WaitForContainer

func (c *Client) WaitForContainer(ctx context.Context, containerName string) error

WaitForContainer waits until a container is running.

type ComposeOptions

type ComposeOptions struct {
	ComposeFile string
	ProjectName string
	Env         map[string]string
	Volumes     []VolumeMount
	Stdout      io.Writer // Optional: stream stdout here
	Stderr      io.Writer // Optional: stream stderr here
}

ComposeOptions configures a compose up operation.

type ExecOptions

type ExecOptions struct {
	Workdir string
	Env     map[string]string
	Stdout  io.Writer
	Stderr  io.Writer
}

ExecOptions configures a container exec operation.

type VolumeMount

type VolumeMount struct {
	Source   string
	Target   string
	ReadOnly bool
}

VolumeMount represents a volume to mount into containers.

Jump to

Keyboard shortcuts

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