docker

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2019 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPGImage     = "docker.io/library/postgres:11.1-alpine"
	DefaultRabbitImage = "docker.io/library/rabbitmq:alpine"
)

Variables

This section is empty.

Functions

func NewClient

func NewClient() (*ispDockerClient, error)

Types

type ContainerContext

type ContainerContext struct {
	// contains filtered or unexported fields
}

func (*ContainerContext) Close

func (ctx *ContainerContext) Close() error

force delete container and image

func (*ContainerContext) ForceRemoveContainer

func (ctx *ContainerContext) ForceRemoveContainer() error

func (*ContainerContext) ForceRemoveImage

func (ctx *ContainerContext) ForceRemoveImage() error

type NetworkContext

type NetworkContext struct {
	// contains filtered or unexported fields
}

func (*NetworkContext) Close

func (ctx *NetworkContext) Close() error

type Option

type Option func(opts *options)

func PullImage

func PullImage(registryLogin string, registryPassword string) Option

if set image pulls first, registryLogin and registryPassword are optional

func WithEnv

func WithEnv(vars map[string]string) Option

set environments variables

func WithLogger

func WithLogger(logger io.Writer) Option

redirect docker container runtime logs

func WithName

func WithName(containerName string) Option

set container name and hostname in docker network by default

func WithNetwork

func WithNetwork(ctx *NetworkContext) Option

if set, container joins to specified network

func WithPortBindings

func WithPortBindings(mapping map[string]string) Option

bind ports host_machine_port -> container_exposed_port

Jump to

Keyboard shortcuts

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