whaler

package module
v0.0.0-...-55fca82 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2018 License: MIT Imports: 20 Imported by: 0

README

whaler

High Level Docker Client for Go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildImageWithDockerfile

func BuildImageWithDockerfile(config BuildImageConfig) (string, error)

BuildImageWithDockerfile builds an image using a specific dockerfile

func CreateContainer

func CreateContainer(config CreateContainerConfig) (string, error)

CreateContainer creates a new container on Docker

func Publish

func Publish(image, username, password string) (string, error)

Publish image to registry

func RemoveContainer

func RemoveContainer(id string, force bool) error

RemoveContainer by Id the container links and volumes will be removed too

func RestartContainer

func RestartContainer(identifier string, timeout *time.Duration) error

RestartContainer by Id or Name

func RunCommand

func RunCommand(containerID string, commands ...string) (*bufio.Reader, error)

func StartContainer

func StartContainer(id string) error

StartContainer starts container by id

func StopContainer

func StopContainer(id string, timeout *time.Duration) error

StopContainer stops container by id

Types

type BuildImageConfig

type BuildImageConfig struct {
	PathContext string
	Dockerfile  string
	Tag         string
}

BuildImageConfig is a basic configuration to build an image

type Container

type Container struct {
	Name    string
	ID      string
	Image   string
	Volumes []string
	Env     []string
	Ports   []string
}

Container is a basic representation of a docker container

func FindContainerByIdentifier

func FindContainerByIdentifier(identifier string, all bool) (Container, error)

FindContainerByIdentifier finds container by id or name

func GetContainers

func GetContainers(all bool) ([]Container, error)

GetContainers from docker

type CreateContainerConfig

type CreateContainerConfig struct {
	Name        string
	Image       string
	Volumes     []string
	Env         []string
	Ports       []string
	NetworkName string
}

CreateContainerConfig is a basic configuration structure to create a docker container

type Image

type Image struct {
	ID     string
	Name   string
	Labels map[string]string
	Tags   []string
}

Image is a basic representation of a docker image

func ListImages

func ListImages() ([]Image, error)

type ImageConfig

type ImageConfig struct {
}

type Network

type Network struct {
	Name string
	ID   string
}

Network is a basic representation of a docker network

func FindNetworkByName

func FindNetworkByName(name string) (*Network, error)

FindNetworkByName look for a docker network with specific name

func GetNetworks

func GetNetworks() ([]Network, error)

GetNetworks from docker

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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