docker

package
v0.0.0-...-d090841 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RandContainerName

func RandContainerName() string

RandContainerName generate a random name for a docker container base on a timestamp

Types

type Config

type Config struct {
	Volumes    []VolumeConfig
	Env        map[string]string
	WorkingDir string
	Entrypoint string
	Name       string
	Commands   []string
	// contains filtered or unexported fields
}

type Container

type Container struct {
	StepId string

	container.ContainerCreateCreatedBody

	context.Context
	Name string
	// contains filtered or unexported fields
}

func NewContainer

func NewContainer(config *DockerImageConfig, stepId string) (*Container, error)

NewContainer create a new container instance from a configuration

func (*Container) Init

func (c *Container) Init(ctx ctx.WorkflowContext) error

Init initialize the container and its configuration

func (*Container) PullImage

func (c *Container) PullImage(ctx ctx.WorkflowContext) error

func (*Container) Run

func (c *Container) Run(ctx ctx.WorkflowContext) (map[string]string, error)

type DockerImageConfig

type DockerImageConfig struct {
	Image   string
	Command string
	Config
}

type VolumeConfig

type VolumeConfig struct {
	Label            string
	ContainerMapping string
	ReadOnly         bool
	Persistent       bool
}

Jump to

Keyboard shortcuts

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