docker

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SupportedArchitectures = []string{"x86_64", "aarch64"}

Functions

func DownloadDockerCliBinary added in v0.2.0

func DownloadDockerCliBinary(version, target string) error

Types

type Container

type Container struct {
	ID              string
	UID             int
	GID             int
	Inputs          *Input
	Network         *Network
	Vol             *volume.Volume
	DockerDaemonVol *volume.Volume
	// contains filtered or unexported fields
}

func NewContainer

func NewContainer(inputs *Input) *Container

func (*Container) CopyToContainer

func (c *Container) CopyToContainer(ctx context.Context, source, target string, excludePatterns []string) error

func (*Container) CopyToHost

func (c *Container) CopyToHost(ctx context.Context, source, target string) error

func (*Container) Create

func (c *Container) Create(ctx context.Context, net *Network, requireVol bool, mounts []mount.Mount) error

func (*Container) Destroy

func (c *Container) Destroy(ctx context.Context) error

func (*Container) Exec

func (c *Container) Exec(ctx context.Context, workdir string, cmd []string, outputHandler func(reader io.Reader) error) error

func (*Container) GetLogs

func (c *Container) GetLogs(ctx context.Context, handler func(reader io.Reader) error) error

func (*Container) IsImageExists

func (c *Container) IsImageExists(ctx context.Context) (bool, error)

func (*Container) Pull

func (c *Container) Pull(ctx context.Context) error

func (*Container) Start

func (c *Container) Start(ctx context.Context) error

func (*Container) Wait

func (c *Container) Wait(ctx context.Context) error

type Input

type Input struct {
	Name         string
	NetworkAlias string
	Image        *models.Image
	WorkDir      string
	HostDir      string
	Envs         map[string]string
	Entrypoint   []string
}

type Network

type Network struct {
	ID   string
	Name string

	Containers []*Container
	// contains filtered or unexported fields
}

func NewNetwork

func NewNetwork(name string) *Network

func (*Network) AddService added in v0.3.0

func (n *Network) AddService(c *Container)

func (*Network) Create

func (n *Network) Create(ctx context.Context) error

func (*Network) Destroy

func (n *Network) Destroy(ctx context.Context) error

Jump to

Keyboard shortcuts

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