{"modulePath":"github.com/rastasheep/packer-builder-docker-commit","version":"v0.0.0-20140901210651-e55bc06b5112","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package docker_commit\n\n## Constants\n\n```go\nconst BuilderId = \"packer.docker\"\n```\n\n## Types\n\n```go\ntype Builder struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (b *Builder) Cancel()\n```\n\n```go\nfunc (b *Builder) Prepare(raws ...interface{}) ([]string, error)\n```\n\n```go\nfunc (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packer.Artifact, error)\n```\n\n```go\ntype Communicator struct {\n\tContainerId  string\n\tHostDir      string\n\tContainerDir string\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (c *Communicator) Download(src string, dst io.Writer) error\n```\n\n```go\nfunc (c *Communicator) Start(remote *packer.RemoteCmd) error\n```\n\n```go\nfunc (c *Communicator) Upload(dst string, src io.Reader) error\n```\n\n```go\nfunc (c *Communicator) UploadDir(dst string, src string, exclude []string) error\n```\n\n```go\ntype Config struct {\n\tcommon.PackerConfig `mapstructure:\",squash\"`\n\n\tExportPath string `mapstructure:\"export_path\"`\n\tCommitTag  string `mapstructure:\"commit_tag\"`\n\tExport     bool\n\tImage      string\n\tPull       bool\n\tRunCommand []string `mapstructure:\"run_command\"`\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewConfig(raws ...interface{}) (*Config, []string, error)\n```\n\n```go\ntype ContainerConfig struct {\n\tImage      string\n\tRunCommand []string\n\tVolumes    map[string]string\n}\n```\nContainerConfig is the configuration used to start a container.\n\n```go\ntype DockerDriver struct {\n\tUi  packer.Ui\n\tTpl *packer.ConfigTemplate\n}\n```\n\n```go\nfunc (d *DockerDriver) Commit(id string, tag string) (string, error)\n```\n\n```go\nfunc (d *DockerDriver) DeleteImage(id string) error\n```\n\n```go\nfunc (d *DockerDriver) Export(id string, dst io.Writer) error\n```\n\n```go\nfunc (d *DockerDriver) Import(path string, repo string) (string, error)\n```\n\n```go\nfunc (d *DockerDriver) Pull(image string) error\n```\n\n```go\nfunc (d *DockerDriver) Push(name string) error\n```\n\n```go\nfunc (d *DockerDriver) StartContainer(config *ContainerConfig) (string, error)\n```\n\n```go\nfunc (d *DockerDriver) StopContainer(id string) error\n```\n\n```go\nfunc (d *DockerDriver) Verify() error\n```\n\n```go\ntype Driver interface {\n\t// Commit the container to a tag\n\tCommit(id, tag string) (string, error)\n\n\t// Delete an image that is imported into Docker\n\tDeleteImage(id string) error\n\n\t// Export exports the container with the given ID to the given writer.\n\tExport(id string, dst io.Writer) error\n\n\t// Import imports a container from a tar file\n\tImport(path, repo string) (string, error)\n\n\t// Pull should pull down the given image.\n\tPull(image string) error\n\n\t// Push pushes an image to a Docker index/registry.\n\tPush(name string) error\n\n\t// StartContainer starts a container and returns the ID for that container,\n\t// along with a potential error.\n\tStartContainer(*ContainerConfig) (string, error)\n\n\t// StopContainer forcibly stops a container.\n\tStopContainer(id string) error\n\n\t// Verify verifies that the driver can run\n\tVerify() error\n}\n```\nDriver 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.\n\n```go\ntype ExportArtifact struct {\n\t// contains filtered or unexported fields\n}\n```\nExportArtifact is an Artifact implementation for when a container is exported from docker into a single flat file.\n\n```go\nfunc (*ExportArtifact) BuilderId() string\n```\n\n```go\nfunc (a *ExportArtifact) Destroy() error\n```\n\n```go\nfunc (a *ExportArtifact) Files() []string\n```\n\n```go\nfunc (*ExportArtifact) Id() string\n```\n\n```go\nfunc (a *ExportArtifact) String() string\n```\n\n```go\ntype ImportArtifact struct {\n\tBuilderIdValue string\n\tDriver         Driver\n\tIdValue        string\n}\n```\nImportArtifact is an Artifact implementation for when a container is exported from docker into a single flat file.\n\n```go\nfunc (a *ImportArtifact) BuilderId() string\n```\n\n```go\nfunc (a *ImportArtifact) Destroy() error\n```\n\n```go\nfunc (*ImportArtifact) Files() []string\n```\n\n```go\nfunc (a *ImportArtifact) Id() string\n```\n\n```go\nfunc (a *ImportArtifact) String() string\n```\n\n```go\ntype MockDriver struct {\n\tCommitCalled      bool\n\tCommitContainerId string\n\tCommitImageId     string\n\tCommitErr         error\n\n\tDeleteImageCalled bool\n\tDeleteImageId     string\n\tDeleteImageErr    error\n\n\tImportCalled bool\n\tImportPath   string\n\tImportRepo   string\n\tImportId     string\n\tImportErr    error\n\n\tPushCalled bool\n\tPushName   string\n\tPushErr    error\n\n\tExportReader io.Reader\n\tExportError  error\n\tPullError    error\n\tStartID      string\n\tStartError   error\n\tStopError    error\n\tVerifyError  error\n\n\tExportCalled bool\n\tExportID     string\n\tPullCalled   bool\n\tPullImage    string\n\tStartCalled  bool\n\tStartConfig  *ContainerConfig\n\tStopCalled   bool\n\tStopID       string\n\tVerifyCalled bool\n}\n```\nMockDriver is a driver implementation that can be used for tests.\n\n```go\nfunc (d *MockDriver) Commit(id string, tag string) (string, error)\n```\n\n```go\nfunc (d *MockDriver) DeleteImage(id string) error\n```\n\n```go\nfunc (d *MockDriver) Export(id string, dst io.Writer) error\n```\n\n```go\nfunc (d *MockDriver) Import(path, repo string) (string, error)\n```\n\n```go\nfunc (d *MockDriver) Pull(image string) error\n```\n\n```go\nfunc (d *MockDriver) Push(name string) error\n```\n\n```go\nfunc (d *MockDriver) StartContainer(config *ContainerConfig) (string, error)\n```\n\n```go\nfunc (d *MockDriver) StopContainer(id string) error\n```\n\n```go\nfunc (d *MockDriver) Verify() error\n```\n\n```go\ntype StepCommit struct {\n\t// contains filtered or unexported fields\n}\n```\nStepCommit commits the container to a image.\n\n```go\nfunc (s *StepCommit) Cleanup(state multistep.StateBag)\n```\n\n```go\nfunc (s *StepCommit) Run(state multistep.StateBag) multistep.StepAction\n```\n\n```go\ntype StepExport struct{}\n```\nStepExport exports the container to a flat tar file.\n\n```go\nfunc (s *StepExport) Cleanup(state multistep.StateBag)\n```\n\n```go\nfunc (s *StepExport) Run(state multistep.StateBag) multistep.StepAction\n```\n\n```go\ntype StepProvision struct{}\n```\n\n```go\nfunc (s *StepProvision) Cleanup(state multistep.StateBag)\n```\n\n```go\nfunc (s *StepProvision) Run(state multistep.StateBag) multistep.StepAction\n```\n\n```go\ntype StepPull struct{}\n```\n\n```go\nfunc (s *StepPull) Cleanup(state multistep.StateBag)\n```\n\n```go\nfunc (s *StepPull) Run(state multistep.StateBag) multistep.StepAction\n```\n\n```go\ntype StepRun struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (s *StepRun) Cleanup(state multistep.StateBag)\n```\n\n```go\nfunc (s *StepRun) Run(state multistep.StateBag) multistep.StepAction\n```\n\n```go\ntype StepTempDir struct {\n\t// contains filtered or unexported fields\n}\n```\nStepTempDir creates a temporary directory that we use in order to share data with the docker container over the communicator.\n\n```go\nfunc (s *StepTempDir) Cleanup(state multistep.StateBag)\n```\n\n```go\nfunc (s *StepTempDir) Run(state multistep.StateBag) multistep.StepAction\n```\n\n","path":"github.com/rastasheep/packer-builder-docker-commit/builder/docker_commit","name":"docker_commit","synopsis":"","isRedistributable":true}
