Documentation ¶
Index ¶
- type AuthConfig
- type Manager
- func (dm *Manager) BuildImage(event *api.Event) error
- func (dm *Manager) BuildImageSpecifyDockerfile(event *api.Event, dockerfilePath string, dockerfileName string) error
- func (dm *Manager) CleanUp(event *api.Event) error
- func (dm *Manager) GetAuthConfig() *AuthConfig
- func (dm *Manager) GetAuthOpts() (authOpts docker_client.AuthConfigurations)
- func (dm *Manager) GetDockerAuthConfig() *AuthConfig
- func (dm *Manager) GetDockerClient() *docker_client.Client
- func (dm *Manager) GetDockerEndPoint() string
- func (dm *Manager) GetDockerRegistry() string
- 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) error
- func (dm *Manager) RemoveContainer(ID string) error
- func (dm *Manager) RemoveImage(name string) error
- func (dm *Manager) RemoveNetwork(networkID 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 caicloud 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 {
// contains filtered or unexported fields
}
Manager manages all docker operations, like build, push, etc.
func NewManager ¶
NewManager creates a new docker manager.
func (*Manager) BuildImage ¶
BuildImage builds image from event.
func (*Manager) BuildImageSpecifyDockerfile ¶
func (dm *Manager) BuildImageSpecifyDockerfile(event *api.Event, dockerfilePath string, dockerfileName string) error
BuildImageSpecifyDockerfile builds docker image with params from event with specify Dockerfile. Build output will be sent to event status output.
func (*Manager) GetAuthConfig ¶
func (dm *Manager) GetAuthConfig() *AuthConfig
GetAuthConfig gets the auth config of docker manager.
func (*Manager) GetAuthOpts ¶
func (dm *Manager) GetAuthOpts() (authOpts docker_client.AuthConfigurations)
GetAuthOpts gets Auth options.
func (*Manager) GetDockerAuthConfig ¶
func (dm *Manager) GetDockerAuthConfig() *AuthConfig
GetDockerAuthConfig returns the docker auth config.
func (*Manager) GetDockerClient ¶
func (dm *Manager) GetDockerClient() *docker_client.Client
GetDockerClient returns the docker client.
func (*Manager) GetDockerEndPoint ¶
GetDockerEndPoint returns the docker endpoint.
func (*Manager) GetDockerRegistry ¶
GetDockerRegistry returns the docker registry.
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 ¶
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) RemoveNetwork ¶
RemoveNetwork removes a network by given 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.