Documentation ¶
Index ¶
- type AuthConfig
- type Manager
- func (dm *Manager) BuildImage(event *api.Event, output filebuffer.FileBuffer) error
- func (dm *Manager) BuildImageSpecifyDockerfile(event *api.Event, dockerfilePath string, dockerfileName string, ...) error
- func (dm *Manager) CleanUp(event *api.Event) error
- func (dm *Manager) GetAuthOpts() (authOpts docker_client.AuthConfigurations)
- func (dm *Manager) GetImageNameNoTag(username, serviceName string) string
- func (dm *Manager) GetImageNameWithTag(username, serviceName, versionName string) string
- func (dm *Manager) IsImagePresent(image string) (bool, error)
- func (dm *Manager) PullImage(imageName string) error
- func (dm *Manager) PushImage(event *api.Event, output filebuffer.FileBuffer) error
- func (dm *Manager) RemoveContainer(ID string) error
- func (dm *Manager) RemoveImage(name string) error
- func (dm *Manager) RunContainer(cco *docker_client.CreateContainerOptions) (string, error)
- func (dm *Manager) StopAndRemoveContainer(ID string) error
- func (dm *Manager) StopContainer(ID string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthConfig ¶
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 ¶
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) GetAuthOpts ¶
func (dm *Manager) GetAuthOpts() (authOpts docker_client.AuthConfigurations)
GetAuthOpts gets Auth options.
func (*Manager) GetImageNameNoTag ¶
GetImageNameNoTag gets the image name without tag from registry, username, service name.
func (*Manager) GetImageNameWithTag ¶
GetImageNameWithTag gets the image name with tag from registry, username, service name and version name.
func (*Manager) IsImagePresent ¶
IsImagePresent checks if given image exists.
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 ¶
RemoveContainer removes a container by given ID.
func (*Manager) RemoveImage ¶
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 ¶
StopAndRemoveContainer stops and removes a container by given ID.
func (*Manager) StopContainer ¶
StopContainer stops a container by given ID.