Documentation
¶
Overview ¶
Package containers provides utilities for interacting with Docker containers
Index ¶
- Variables
- func ContainerLogs(docker *docker.Client, opts LogOptions) (io.ReadCloser, error)
- func GetActiveContainers(docker *docker.Client) ([]types.Container, error)
- func NewDockerClient() (*docker.Client, error)
- func Prune(docker *docker.Client) error
- func PruneAll(docker *docker.Client, exceptions ...string) error
- func StartAndWait(cli *docker.Client, containerID string, out io.Writer) error
- func StopActiveContainers(docker *docker.Client, out io.Writer) error
- func StreamContainerLogs(client *docker.Client, id string, out io.Writer, stop chan struct{}) error
- func Wait(cli *docker.Client, id string, stop chan struct{}) (int64, error)
- type ContainerStopper
- type LogOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoContainers is the response to indicate that no containers are active ErrNoContainers = errors.New("There are currently no active containers") )
Functions ¶
func ContainerLogs ¶
func ContainerLogs(docker *docker.Client, opts LogOptions) (io.ReadCloser, error)
ContainerLogs get logs ;)
func GetActiveContainers ¶
GetActiveContainers returns all active containers and returns and error if the Daemon is the only active container
func NewDockerClient ¶ added in v0.4.2
NewDockerClient creates a new Docker Client from ENV values and negotiates the correct API version
func PruneAll ¶ added in v0.4.1
PruneAll forcibly removes all images except given exceptions (repo tag names)
func StartAndWait ¶ added in v0.4.3
StartAndWait starts and waits for container to exit
func StopActiveContainers ¶
StopActiveContainers kills all active project containers (ie not including daemon)
func StreamContainerLogs ¶
StreamContainerLogs streams logs from given container ID. Best used as a goroutine.
Types ¶
type ContainerStopper ¶
ContainerStopper is a function interface
Click to show internal directories.
Click to hide internal directories.