docker

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Params

type Params struct {
	// Domain is the target domain for Pygmy to use.
	Domain string
}

Params is an arbitrary struct to pass around configuration from the top level to the lowest level - such as variable input to one of the containers.

type Service

type Service struct {
	Config        containertypes.Config
	HostConfig    containertypes.HostConfig
	Image         string `yaml:"image"`
	NetworkConfig networktypes.NetworkingConfig
}

func (*Service) Clean

func (Service *Service) Clean(ctx context.Context, cli *client.Client) error

Clean will cleanup and remove the container.

func (*Service) Create

func (Service *Service) Create(ctx context.Context, cli *client.Client) error

Create will perform a series of checks to see if the container starting is supposed be removed before-hand and will check to see if the container is running before it is actually started.

func (*Service) DockerCreate

func (Service *Service) DockerCreate(ctx context.Context, cli *client.Client) error

DockerCreate will setup and run a given container.

func (*Service) DockerLogs

func (Service *Service) DockerLogs(ctx context.Context, cli *client.Client) ([]byte, error)

DockerLogs will return the logs from the container.

func (*Service) DockerRun

func (Service *Service) DockerRun(ctx context.Context, cli *client.Client) error

DockerRun will start an existing container.

func (*Service) DockerRunInteractive

func (Service *Service) DockerRunInteractive(ctx context.Context, cli *client.Client) error

DockerRunInteractive will start an interactive container.

func (*Service) GetFieldBool

func (Service *Service) GetFieldBool(ctx context.Context, cli *client.Client, field string) (bool, error)

GetFieldBool will get and return a tag on the service using the pygmy convention ("pygmy.*") and return it as a bool.

func (*Service) GetFieldInt

func (Service *Service) GetFieldInt(ctx context.Context, cli *client.Client, field string) (int, error)

GetFieldInt will get and return a tag on the service using the pygmy convention ("pygmy.*") and return it as an int.

func (*Service) GetFieldString

func (Service *Service) GetFieldString(ctx context.Context, cli *client.Client, field string) (string, error)

GetFieldString will get and return a tag on the service using the pygmy convention ("pygmy.*") and return it as a string.

func (*Service) ID

func (Service *Service) ID(ctx context.Context, cli *client.Client) (string, error)

ID will get a types.Container variable for a given running container and it will not retrieve any information on containers that are not running. todo: digests instead of name?

func (*Service) Labels

func (Service *Service) Labels(ctx context.Context, cli *client.Client) (map[string]string, error)

Labels will get a types.Container variable for a given running container and it will not retrieve any information on containers that are not running.

func (*Service) Remove

func (Service *Service) Remove(ctx context.Context, cli *client.Client) error

Remove will stop the container.

func (*Service) SetField

func (Service *Service) SetField(ctx context.Context, cli *client.Client, name string, value interface{}) error

SetField will set a pygmy label to be equal to the string equal of an interface{}, even if it already exists. It should not matter if this container is running or not.

func (*Service) Setup

func (Service *Service) Setup(ctx context.Context, cli *client.Client) error

Setup will detect if the Service's image reference exists and will attempt to run `docker pull` on the non-canonical image if it is not found in the daemon.

func (*Service) Start

func (Service *Service) Start(ctx context.Context, cli *client.Client) error

Start will perform a series of checks to see if the container starting is supposed be removed before-hand and will check to see if the container is running before it is actually started.

func (*Service) Status

func (Service *Service) Status(ctx context.Context, cli *client.Client) (bool, error)

Status will check if the container is running.

func (*Service) Stop

func (Service *Service) Stop(ctx context.Context, cli *client.Client) error

Stop will stop the container.

func (*Service) StopAndRemove

func (Service *Service) StopAndRemove(ctx context.Context, cli *client.Client) error

StopAndRemove will stop and remove the container.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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