docker

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PortBindings added in v0.4.0

func PortBindings(ports ...int) nat.PortMap

func PortSet added in v0.4.0

func PortSet(ports ...int) nat.PortSet

func StartLogs added in v0.4.0

func StartLogs(cli *client.Client, containerID string, loggerName string) error

Types

type Docker

type Docker struct {
	Client *docker.Client
}

Docker is a helper to manage container related actions within nwo.

func GetInstance

func GetInstance() (*Docker, error)

GetInstance a Docker instance, returns nil and an error in case of a failure.

func (*Docker) CheckImagesExist

func (d *Docker) CheckImagesExist(requiredImages ...string) error

CheckImagesExist returns an error if a given container images is not available, returns an error in case of a failure. It receives a list of container image names that are checked.

func (*Docker) Cleanup

func (d *Docker) Cleanup(networkID string, matchName func(name string) bool) error

Cleanup is a helper function to release all container associated with `networkID`, returns an error in case of a failure. It removes all container that meet the condition of the `matchName` predicate function, removes the attached volumes, container images, the network.

func (*Docker) CreateNetwork

func (d *Docker) CreateNetwork(networkID string) error

CreateNetwork starts a docker network with the provided `networkID` as name, returns an error in case of a failure.

func (*Docker) LocalIP

func (d *Docker) LocalIP(networkID string) (string, error)

Jump to

Keyboard shortcuts

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