docker

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ForceStop

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

func NewClient

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

Types

type Container

type Container struct {
	ID    string
	Name  string
	Image string

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

func (*Container) Connect

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

func (*Container) HostPort

func (c *Container) HostPort() string

func (*Container) Logs

func (c *Container) Logs(ctx context.Context, client *client.Client) (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