docker

package
v0.93.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: GPL-3.0 Imports: 35 Imported by: 0

Documentation

Overview

Package docker implements the Docker execution runtime.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BindConfig

type BindConfig struct {
	Allowed bool
}

BindConfig controls bind mount behavior.

type BindMounter

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

BindMounter manages host-path bind mounts with an allow/deny policy.

func NewBindMounter

func NewBindMounter(cfg BindConfig) *BindMounter

NewBindMounter creates a new BindMounter with the given configuration.

func (*BindMounter) Mount

func (m *BindMounter) Mount(_ context.Context, mnt *types.Mount) error

Mount ensures the source directory exists and registers the bind mount. It returns an error if bind mounts are not allowed.

func (*BindMounter) Unmount

func (*BindMounter) Unmount(_ context.Context, _ *types.Mount) error

Unmount is a no-op for bind mounts since the host path persists after use.

type KubernetesConfig

type KubernetesConfig struct {
	AllNamespaces string `json:"allNamespaces,omitempty"`
}

KubernetesConfig contains Kubernetes orchestrator settings

type Option

type Option = func(rt *Runtime)

func WithClient added in v0.93.0

func WithClient(c *client.Client) Option

WithClient sets a pre-existing Docker client, avoiding the creation of a duplicate client when sharing one across components (e.g. VolumeMounter).

func WithConfig

func WithConfig(config string) Option

WithConfig sets the docker config file path for registry authentication.

func WithMounter

func WithMounter(mounter runtime.Mounter) Option

type Runtime

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

func NewRuntime

func NewRuntime(opts ...Option) (*Runtime, error)

func (*Runtime) Close added in v0.92.0

func (d *Runtime) Close() error

Close shuts down the Docker runtime, stopping the puller goroutine and closing the Docker client connection.

func (*Runtime) HealthCheck

func (d *Runtime) HealthCheck(ctx context.Context) error

func (*Runtime) Run

func (d *Runtime) Run(ctx context.Context, t *types.Task) error

func (*Runtime) Stop

func (d *Runtime) Stop(ctx context.Context, t *types.Task) error

type TmpfsMounter

type TmpfsMounter struct {
}

func NewTmpfsMounter

func NewTmpfsMounter() *TmpfsMounter

func (*TmpfsMounter) Mount

func (*TmpfsMounter) Mount(_ context.Context, mnt *types.Mount) error

func (*TmpfsMounter) Unmount

func (*TmpfsMounter) Unmount(_ context.Context, _ *types.Mount) error

type VolumeMounter

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

VolumeMounter manages Docker volume lifecycle: creation on Mount, removal on Unmount.

func NewVolumeMounter

func NewVolumeMounter() (*VolumeMounter, error)

NewVolumeMounter creates a VolumeMounter with its own Docker client.

func NewVolumeMounterWithClient added in v0.93.0

func NewVolumeMounterWithClient(c *client.Client) *VolumeMounter

NewVolumeMounterWithClient creates a VolumeMounter using the provided Docker client, allowing the client to be shared with the Runtime to reduce resource usage.

func (*VolumeMounter) Mount

func (m *VolumeMounter) Mount(ctx context.Context, mn *types.Mount) error

Mount creates a new Docker volume and sets its generated name on mn.Source.

func (*VolumeMounter) Unmount

func (m *VolumeMounter) Unmount(ctx context.Context, mn *types.Mount) error

Unmount removes the Docker volume identified by mn.Source.

Jump to

Keyboard shortcuts

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