containers

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package containers provides utilities for interacting with Docker containers

Index

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

func GetActiveContainers(docker *docker.Client) ([]types.Container, error)

GetActiveContainers returns all active containers and returns and error if the Daemon is the only active container

func Prune added in v0.4.1

func Prune(docker *docker.Client) error

Prune clears up unused Docker assets.

func PruneAll added in v0.4.1

func PruneAll(docker *docker.Client, exceptions ...string) error

PruneAll forcibly removes all images except given exceptions (repo tag names)

func StopActiveContainers

func StopActiveContainers(docker *docker.Client, out io.Writer) error

StopActiveContainers kills all active project containers (ie not including daemon)

func StreamContainerLogs

func StreamContainerLogs(client *docker.Client, id string, out io.Writer,
	stop chan struct{}) error

StreamContainerLogs streams logs from given container ID. Best used as a goroutine.

Types

type ContainerStopper

type ContainerStopper func(*docker.Client, io.Writer) error

ContainerStopper is a function interface

type LogOptions

type LogOptions struct {
	Container    string
	Stream       bool
	Detailed     bool
	NoTimestamps bool
}

LogOptions is used to configure retrieved container logs

Jump to

Keyboard shortcuts

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