docker

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckDaemon added in v1.1.0

func CheckDaemon() error

func ForceStop

func ForceStop(ctx context.Context, name string, client *client.Client) error

func NewClient

func NewClient() (*client.Client, error)

Types

type ComposeService added in v1.2.0

type ComposeService struct {
	ContainerName string   `json:"container_name"`
	Entrypoint    []string `json:"entrypoint,omitempty"`
	Image         string   `json:"image"`
	Ports         []string `json:"ports"`
	Environment   []string `json:"environment"`
}

type Container

type Container struct {
	ID     string
	Name   string
	Image  string
	Online bool

	CreateContainerOptions []ContainerOption
	CreateHostOptions      []HostOption
	// contains filtered or unexported fields
}

func (*Container) HostPort

func (c *Container) HostPort() string

func (*Container) Logs

func (c *Container) Logs(ctx context.Context, client *client.Client, since time.Time, follow bool) (io.ReadCloser, error)

func (*Container) LookupHostConfig

func (c *Container) LookupHostConfig(ctx context.Context, client *client.Client) (*Container, error)

func (*Container) Remove

func (c *Container) Remove(ctx context.Context, client *client.Client) error

func (*Container) Start

func (c *Container) Start(ctx context.Context, client *client.Client, restart bool) (*Container, error)

type ContainerOption

type ContainerOption func(*container.Config)

func WithEntrypoint

func WithEntrypoint(entrypoint []string) ContainerOption

func WithEnv

func WithEnv(env []string) ContainerOption

func WithErrorLoggingLevel

func WithErrorLoggingLevel() ContainerOption

func WithImage

func WithImage(image string) ContainerOption

func WithPort

func WithPort(port nat.Port) ContainerOption

type HostOption

type HostOption func(*container.HostConfig)

func WithExtraHost

func WithExtraHost() HostOption

func WithHostPortBinding

func WithHostPortBinding(containerPort nat.Port) HostOption

func WithVolumeBind

func WithVolumeBind(bind string) HostOption

Jump to

Keyboard shortcuts

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