docker

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2019 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectContainerToNetwork

func ConnectContainerToNetwork(cli *client.Client, networkID string, containerID string, ip string) error

ConnectContainerToNetwork connects a created container to an extant network

func CopyFromContainer

func CopyFromContainer(cli *client.Client, containerID, containerSrcPath, localDestPath string) error

CopyFromContainer copies a file / directory from a container

func CopyToContainer

func CopyToContainer(cli *client.Client, containerID, localSrcPath, containerDestPath string) error

CopyToContainer copies a directory / file to a container

func CreateContainerFromImage

func CreateContainerFromImage(cli *client.Client, imageName string, isImageRemote bool,
	nodeName string, cmd strslice.StrSlice, start bool) (string, error)

CreateContainerFromImage creates a container, returning its ID

func CreateNetwork

func CreateNetwork(cli *client.Client, networkName, subnet, iprange, gateway string) (string, error)

CreateNetwork creates a docker network

func GetContainers

func GetContainers(cli *client.Client, output bool) (map[string]string, error)

GetContainers lists containers.

func GetDockerClient

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

GetDockerClient returns a docker client

func GetImages

func GetImages(cli *client.Client, showOutput bool) (map[string]string, error)

GetImages retrieves a list of tags from the local docker repository

func GetNetworks

func GetNetworks(cli *client.Client, output bool) (map[string]string, error)

GetNetworks lists networks

func ListImages

func ListImages(cli *client.Client) error

ListImages lists docker images. It is a wrapper to GetImages

func RemoveContainer

func RemoveContainer(cli *client.Client, containerID string, force, removelinks, removevolumes bool) error

RemoveContainer removes a container

func RemoveNetwork

func RemoveNetwork(cli *client.Client, networkID string) error

RemoveNetwork removes a network

func SafeCreateNetwork

func SafeCreateNetwork(cli *client.Client, networkName, subnet, iprange, gateway string, force, useExisting bool) (string, error)

SafeCreateNetwork provides a wrapper to CreateNetwork, but first ensures that the network does not already exist.

func ShowLogs

func ShowLogs(client *client.Client, containerID string) error

ShowLogs shows a docker container logs

func StartContainer

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

StartContainer starts a container previously created by CreateContainerFromImage

func StopContainer

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

StopContainer stops a container

func StopNetwork

func StopNetwork(networkName string, force bool) error

StopNetwork stops a network. Force removes nodes too.

func StopNode

func StopNode(networkName, nodeName string, force bool) error

StopNode stops a node. If force is set the container is removed too.

Types

This section is empty.

Jump to

Keyboard shortcuts

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