dockerutil

package
v0.0.0-...-5730ae1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateBytesUUID

func GenerateBytesUUID() []byte

GenerateBytesUUID returns a UUID based on RFC 4122 returning the generated bytes.

Types

type Composition

type Composition struct {
	DockerClient     *docker.Client
	APIContainers    []*docker.APIContainers
	ComposeFilesYaml string
	ProjectName      string
	Dir              string
	DockerHelper     DockerHelper
}

Composition represents a docker-compose execution and management.

func NewComposition

func NewComposition(projectName, composeFilesYaml, dir string) (composition *Composition, err error)

NewComposition create a new Composition specifying the project name (for isolation) and the compose files.

func (*Composition) Decompose

func (c *Composition) Decompose(dir string) (output string, err error)

Decompose decompose the composition Will also remove any containers with the same ProjectName prefix (eg. chaincode containers).

func (*Composition) GenerateLogs

func (c *Composition) GenerateLogs(dir, logName string) error

GenerateLogs to file.

func (*Composition) GetAPIContainerForComposeService

func (c *Composition) GetAPIContainerForComposeService(
	composeService string) (apiContainer *docker.APIContainers, err error)

GetAPIContainerForComposeService return the docker.APIContainers with the supplied composeService name.

func (*Composition) GetContainerIDs

func (c *Composition) GetContainerIDs(dir string) (containerIDs []string, err error)

GetContainerIDs returns the container IDs for the composition (NOTE: does NOT include those defined outside composition, eg. chaincode containers).

func (*Composition) GetIPAddressForComposeService

func (c *Composition) GetIPAddressForComposeService(composeService string) (ipAddress string, err error)

GetIPAddressForComposeService returns the IPAddress of the container with the supplied composeService name.

type DockerHelper

type DockerHelper interface {
	RemoveContainersWithNamePrefix(namePrefix string) error
}

DockerHelper helper for docker specific functions.

func NewDockerCmdlineHelper

func NewDockerCmdlineHelper() DockerHelper

NewDockerCmdlineHelper returns a new command line DockerHelper instance.

Jump to

Keyboard shortcuts

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