Documentation
¶
Index ¶
- Constants
- Variables
- type FormattingWriter
- type ImageManager
- func (d *ImageManager) BuildImage(dockerfileDirPath, name string, stdoutWriter io.WriteCloser) error
- func (d *ImageManager) CreateImage(containerID string, repository string, tag string, message string, ...) (*dockerclient.Image, error)
- func (d *ImageManager) FindImage(imageName string) (*dockerclient.Image, error)
- func (d *ImageManager) RemoveContainer(containerID string) error
- func (d *ImageManager) RemoveImage(imageName string) error
- func (d *ImageManager) RemoveVolumes(container *dockerclient.Container) error
- func (d *ImageManager) RunInContainer(opts RunInContainerOpts) (exitCode int, container *dockerclient.Container, err error)
- type RunInContainerOpts
- type StringFormatter
Constants ¶
const ( // ContainerInPath is the input path for fissile ContainerInPath = "/fissile-in" // ContainerOutPath is the output path for fissile ContainerOutPath = "/fissile-out" )
Variables ¶
var ( // ErrImageNotFound is the error returned when an image is not found. ErrImageNotFound = fmt.Errorf("Image not found") )
Functions ¶
This section is empty.
Types ¶
type FormattingWriter ¶
FormattingWriter wraps an io.WriteCloser so lines can be individually formatted.
func NewFormattingWriter ¶
func NewFormattingWriter(writer io.Writer, aColorizer StringFormatter) *FormattingWriter
NewFormattingWriter - Get a FormattingWriter here. aColorizer can be nil
func (*FormattingWriter) Close ¶
func (w *FormattingWriter) Close() error
Close ensures the remaining data is written to the io.Writer
type ImageManager ¶
type ImageManager struct {
// contains filtered or unexported fields
}
ImageManager handles Docker images
func NewImageManager ¶
func NewImageManager() (*ImageManager, error)
NewImageManager creates an instance of ImageManager
func (*ImageManager) BuildImage ¶
func (d *ImageManager) BuildImage(dockerfileDirPath, name string, stdoutWriter io.WriteCloser) error
BuildImage builds a docker image using a directory that contains a Dockerfile
func (*ImageManager) CreateImage ¶
func (d *ImageManager) CreateImage(containerID string, repository string, tag string, message string, cmd []string) (*dockerclient.Image, error)
CreateImage will create a Docker image
func (*ImageManager) FindImage ¶
func (d *ImageManager) FindImage(imageName string) (*dockerclient.Image, error)
FindImage will lookup an image in Docker
func (*ImageManager) RemoveContainer ¶
func (d *ImageManager) RemoveContainer(containerID string) error
RemoveContainer will remove a container from Docker
func (*ImageManager) RemoveImage ¶
func (d *ImageManager) RemoveImage(imageName string) error
RemoveImage will remove an image from Docker's internal registry
func (*ImageManager) RemoveVolumes ¶
func (d *ImageManager) RemoveVolumes(container *dockerclient.Container) error
RemoveVolumes removes any temporary volumes assoicated with a container
func (*ImageManager) RunInContainer ¶
func (d *ImageManager) RunInContainer(opts RunInContainerOpts) (exitCode int, container *dockerclient.Container, err error)
RunInContainer will execute a set of commands within a running Docker container
type RunInContainerOpts ¶
type RunInContainerOpts struct { ContainerName string ImageName string Cmd []string // Mount points, src -> dest // dest may be special values ContainerInPath, ContainerOutPath Mounts map[string]string // Create local volumes. Volumes are destroyed unless KeepContainer is true Volumes map[string]map[string]string KeepContainer bool StdoutWriter io.Writer StderrWriter io.Writer }
RunInContainerOpts encapsulates the options to RunInContainer()
type StringFormatter ¶
StringFormatter is a formatting string function
func ColoredBuildStringFunc ¶
func ColoredBuildStringFunc(buildName string) StringFormatter
ColoredBuildStringFunc returns a formatting function for colorizing strings.