docker

package
v0.0.30 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2024 License: MPL-2.0 Imports: 27 Imported by: 0

Documentation

Overview

docker holds useful things for interacting with docker

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(opts ...Option) (*docker, error)

Types

type Content

type Content struct {
	Target string
	Dir    string
	// contains filtered or unexported fields
}

func NewContent

func NewContent(r io.Reader, target string, size int64) *Content

func NewContentFromFile

func NewContentFromFile(f *os.File, target string) (*Content, error)

func NewContentFromString

func NewContentFromString(s string, target string) *Content

func (Content) Read

func (c Content) Read(p []byte) (n int, err error)

Read implements io.Reader.

type NetworkAttachment

type NetworkAttachment struct {
	Name string
	ID   string
}

type NetworkRequest

type NetworkRequest struct {
	// Name is the name of the network to create. If empty, a random name will be
	// generated.
	Name string
	// IPAM is the IP Address Management configuration for the network. Most of
	// the time this can be left empty and set by the daemon.
	IPAM       *network.IPAM
	Labels     map[string]string
	EnableIPv6 bool
}

type Option

type Option func(*docker) error

func WithClient

func WithClient(cli *client.Client) Option

func WithClientOpts

func WithClientOpts(opts ...client.Opt) Option

type Request

type Request struct {
	Ref          name.Reference
	Name         string
	Entrypoint   []string
	User         string // uid:gid
	Env          []string
	Cmd          []string
	Labels       map[string]string
	Privileged   bool
	Resources    ResourcesRequest
	Mounts       []mount.Mount
	Networks     []NetworkAttachment
	Timeout      time.Duration
	HealthCheck  *container.HealthConfig
	Contents     []*Content
	PortBindings nat.PortMap
}

type ResourcesRequest

type ResourcesRequest struct {
	CpuRequest resource.Quantity
	CpuLimit   resource.Quantity

	MemoryRequest resource.Quantity
	MemoryLimit   resource.Quantity
}

type Response

type Response struct {
	ID   string
	Name string
	// contains filtered or unexported fields
}

Response is returned from a Start() request.

func (*Response) Run

func (r *Response) Run(ctx context.Context, cmd harness.Command) error

type VolumeRequest

type VolumeRequest struct {
	// Name is the name of the volume to create, if empty a random name will be
	// generated by the daemon
	Name   string
	Target string
	Labels map[string]string
}

Jump to

Keyboard shortcuts

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