docker

package
v0.0.0-...-1806480 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2017 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthConfig

type AuthConfig struct {
	Username string
	Password string
}

AuthConfig contains the username and password to access docker registry.

func NewAuthConfig

func NewAuthConfig(username, password string) (*AuthConfig, error)

NewAuthConfig returns a new AuthConfig or returns an error.

type Manager

type Manager struct {
	Client     *docker_client.Client
	Registry   string
	AuthConfig *AuthConfig
	EndPoint   string
}

Manager manages all docker operations, like build, push, etc.

func NewManager

func NewManager(endpoint string, certPath string, registry api.RegistryCompose) (*Manager, error)

NewManager creates a new docker manager.

func (*Manager) BuildImage

func (dm *Manager) BuildImage(event *api.Event, output filebuffer.FileBuffer) error

BuildImage builds image from event.

func (*Manager) BuildImageSpecifyDockerfile

func (dm *Manager) BuildImageSpecifyDockerfile(event *api.Event,
	dockerfilePath string, dockerfileName string, output filebuffer.FileBuffer) error

BuildImageSpecifyDockerfile builds docker image with params from event with specify Dockerfile. Build output will be sent to event status output.

func (*Manager) CleanUp

func (dm *Manager) CleanUp(event *api.Event) error

CleanUp removes images generated during building image

func (*Manager) GetAuthOpts

func (dm *Manager) GetAuthOpts() (authOpts docker_client.AuthConfigurations)

GetAuthOpts gets Auth options.

func (*Manager) GetImageNameNoTag

func (dm *Manager) GetImageNameNoTag(username, serviceName string) string

GetImageNameNoTag gets the image name without tag from registry, username, service name.

func (*Manager) GetImageNameWithTag

func (dm *Manager) GetImageNameWithTag(username, serviceName, versionName string) string

GetImageNameWithTag gets the image name with tag from registry, username, service name and version name.

func (*Manager) IsImagePresent

func (dm *Manager) IsImagePresent(image string) (bool, error)

IsImagePresent checks if given image exists.

func (*Manager) PullImage

func (dm *Manager) PullImage(imageName string) error

PullImage pulls an image by its name.

func (*Manager) PushImage

func (dm *Manager) PushImage(event *api.Event, output filebuffer.FileBuffer) error

PushImage pushes docker image to registry. output will be sent to event status output.

func (*Manager) RemoveContainer

func (dm *Manager) RemoveContainer(ID string) error

RemoveContainer removes a container by given ID.

func (*Manager) RemoveImage

func (dm *Manager) RemoveImage(name string) error

RemoveImage removes an image by its name or ID.

func (*Manager) RunContainer

func (dm *Manager) RunContainer(cco *docker_client.CreateContainerOptions) (string, error)

RunContainer runs a container according to special config

func (*Manager) StopAndRemoveContainer

func (dm *Manager) StopAndRemoveContainer(ID string) error

StopAndRemoveContainer stops and removes a container by given ID.

func (*Manager) StopContainer

func (dm *Manager) StopContainer(ID string) error

StopContainer stops a container by given ID.

Jump to

Keyboard shortcuts

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