Documentation
¶
Index ¶
Constants ¶
View Source
const BuilderId = "packer.docker"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Communicator ¶
type Config ¶
type Config struct {
common.PackerConfig `mapstructure:",squash"`
ExportPath string `mapstructure:"export_path"`
Image string
Pull bool
// contains filtered or unexported fields
}
type ContainerConfig ¶
ContainerConfig is the configuration used to start a container.
type DockerDriver ¶
func (*DockerDriver) Pull ¶
func (d *DockerDriver) Pull(image string) error
func (*DockerDriver) StartContainer ¶
func (d *DockerDriver) StartContainer(config *ContainerConfig) (string, error)
func (*DockerDriver) StopContainer ¶
func (d *DockerDriver) StopContainer(id string) error
func (*DockerDriver) Verify ¶
func (d *DockerDriver) Verify() error
type Driver ¶
type Driver interface {
// Export exports the container with the given ID to the given writer.
Export(id string, dst io.Writer) error
// Pull should pull down the given image.
Pull(image string) error
// StartContainer starts a container and returns the ID for that container,
// along with a potential error.
StartContainer(*ContainerConfig) (string, error)
// StopContainer forcibly stops a container.
StopContainer(id string) error
// Verify verifies that the driver can run
Verify() error
}
Driver is the interface that has to be implemented to communicate with Docker. The Driver interface also allows the steps to be tested since a mock driver can be shimmed in.
type ExportArtifact ¶
type ExportArtifact struct {
// contains filtered or unexported fields
}
ExportArtifact is an Artifact implementation for when a container is exported from docker into a single flat file.
func (*ExportArtifact) BuilderId ¶
func (*ExportArtifact) BuilderId() string
func (*ExportArtifact) Destroy ¶
func (a *ExportArtifact) Destroy() error
func (*ExportArtifact) Files ¶
func (a *ExportArtifact) Files() []string
func (*ExportArtifact) Id ¶
func (*ExportArtifact) Id() string
func (*ExportArtifact) String ¶
func (a *ExportArtifact) String() string
type MockDriver ¶
type MockDriver struct {
ExportReader io.Reader
ExportError error
PullError error
StartID string
StartError error
StopError error
VerifyError error
ExportCalled bool
ExportID string
PullCalled bool
PullImage string
StartCalled bool
StartConfig *ContainerConfig
StopCalled bool
StopID string
VerifyCalled bool
}
MockDriver is a driver implementation that can be used for tests.
func (*MockDriver) Pull ¶
func (d *MockDriver) Pull(image string) error
func (*MockDriver) StartContainer ¶
func (d *MockDriver) StartContainer(config *ContainerConfig) (string, error)
func (*MockDriver) StopContainer ¶
func (d *MockDriver) StopContainer(id string) error
func (*MockDriver) Verify ¶
func (d *MockDriver) Verify() error
type StepExport ¶
type StepExport struct{}
StepExport exports the container to a flat tar file.
func (*StepExport) Cleanup ¶
func (s *StepExport) Cleanup(state multistep.StateBag)
func (*StepExport) Run ¶
func (s *StepExport) Run(state multistep.StateBag) multistep.StepAction
type StepProvision ¶
type StepProvision struct{}
func (*StepProvision) Cleanup ¶
func (s *StepProvision) Cleanup(state multistep.StateBag)
func (*StepProvision) Run ¶
func (s *StepProvision) Run(state multistep.StateBag) multistep.StepAction
type StepTempDir ¶
type StepTempDir struct {
// contains filtered or unexported fields
}
StepTempDir creates a temporary directory that we use in order to share data with the docker container over the communicator.
func (*StepTempDir) Cleanup ¶
func (s *StepTempDir) Cleanup(state multistep.StateBag)
func (*StepTempDir) Run ¶
func (s *StepTempDir) Run(state multistep.StateBag) multistep.StepAction
Click to show internal directories.
Click to hide internal directories.