docker

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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