Documentation
¶
Overview ¶
Package udock implements a simplified Docker API.
Index ¶
- Variables
- type Session
- func (s *Session) Close() error
- func (s *Session) CreateContainer(dockerImage string, containerName string, ports map[string]string) (string, error)
- func (s *Session) PullImage(dockerImage string) error
- func (s *Session) RemoveContainer(containerID string) error
- func (s *Session) RemoveImage(dockerImage string) error
- func (s *Session) StartContainer(containerID string) error
- func (s *Session) VerifyHaveImage(dockerImage string) error
Constants ¶
This section is empty.
Variables ¶
var ( ErrCreatingDockerClient = errors.New("error creating docker client") ErrConnectingToDocker = errors.New("error connecting to docker") ErrListingImages = errors.New("error listing docker images") ErrImageNotPresent = errors.New("docker image is not present") ErrReadingPulledImage = errors.New("error reading image during pull") ErrPullingImage = errors.New("error pulling image") ErrCreatingContainer = errors.New("error creating container") ErrStartingContainer = errors.New("error starting container") ErrTimeout = errors.New("operation timed out") ErrPortMap = errors.New("portmap error") )
package errors
Functions ¶
This section is empty.
Types ¶
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func (*Session) CreateContainer ¶
func (s *Session) CreateContainer(dockerImage string, containerName string, ports map[string]string) (string, error)
CreateContainer creates a container. If the operation succeeds we return a containerID and error is nil. If an error occurs, the container ID is empty and the error is set.
func (*Session) PullImage ¶
PullImage checks if we have an image and if we do not have the image pulls a docker image. Returns a nil error if ok and an error value if something went wrong.
func (*Session) RemoveContainer ¶
RemoveContainer removes a container and forces removal of volumes. If the container is running it is shut down first.
func (*Session) RemoveImage ¶
RemoveImage removes a docker image.
func (*Session) StartContainer ¶
StartContainer starts a docker container that has already been created.
func (*Session) VerifyHaveImage ¶
VerifyHaveImage returns a nil error if we have the image and an error if the docker image is missing or an error occurred when probing if we have the image.