docker

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package docker runs each service as labelled containers on one network, so services reach each other by service name. Only the first replica publishes ports, on 127.0.0.1.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(env core.Env, c *spec.Component) (any, error)

Types

type Options

type Options struct {
	Network  string            `yaml:"network"`
	Registry string            `yaml:"registry"`
	Env      map[string]string `yaml:"env"`
	// Publish exposes the first replica's ports on 127.0.0.1 (random host ports unless docker.publish sets them);
	// off, rig reaches services by container IP.
	Publish *bool `yaml:"publish"`
}

type Runtime

type Runtime struct {
	localhost.Host
	// contains filtered or unexported fields
}

func (*Runtime) Actions

func (r *Runtime) Actions() []core.Action

func (*Runtime) Deploy

func (r *Runtime) Deploy(ctx context.Context, s *spec.Service, rel core.Release) error

func (*Runtime) Discover

func (r *Runtime) Discover(ctx context.Context) ([]core.Workload, error)

func (*Runtime) Exec

func (r *Runtime) Exec(ctx context.Context, s *spec.Service, o core.ExecOptions) error

func (*Runtime) Forward

func (r *Runtime) Forward(ctx context.Context, t core.Target) (string, error)

Forward returns the published port, or else the container's address on its network; answers are cached briefly since health checks ask on every status.

func (*Runtime) LoadImage

func (r *Runtime) LoadImage(context.Context, string) error

LoadImage has nothing to do: the daemon that built the image runs it.

func (*Runtime) Logs

func (r *Runtime) Logs(ctx context.Context, s *spec.Service, o core.LogOptions) (<-chan core.LogLine, error)

func (*Runtime) Registry

func (r *Runtime) Registry() string

func (*Runtime) Restart

func (r *Runtime) Restart(ctx context.Context, s *spec.Service) error

func (*Runtime) Scale

func (r *Runtime) Scale(ctx context.Context, s *spec.Service, n int) error

func (*Runtime) Start

func (r *Runtime) Start(ctx context.Context, s *spec.Service) error

func (*Runtime) Status

func (r *Runtime) Status(ctx context.Context, s *spec.Service) (core.Status, error)

func (*Runtime) StatusAll

func (r *Runtime) StatusAll(ctx context.Context, svcs []*spec.Service) ([]core.Status, error)

StatusAll lists this machine's containers once and answers for every service from that list.

func (*Runtime) Stop

func (r *Runtime) Stop(ctx context.Context, s *spec.Service) error

type Section

type Section struct {
	Image     string            `yaml:"image"`
	Command   []string          `yaml:"command"`
	Args      []string          `yaml:"args"`
	Volumes   []string          `yaml:"volumes"`
	Publish   map[string]int    `yaml:"publish"` // service port name -> host port
	ExtraArgs []string          `yaml:"extra_args"`
	Labels    map[string]string `yaml:"labels"`
	// Container adopts an existing container by name (one made by docker compose, say): rig starts
	// and stops it but never removes or recreates it.
	Container string `yaml:"container"`
	// Bind is the host address published ports listen on (default 127.0.0.1; 0.0.0.0 lets a kind
	// cluster reach a shared service).
	Bind string `yaml:"bind"`
}

Jump to

Keyboard shortcuts

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