github.com/sneal/packer@v0.5.2/builder/docker/artifact_export.go (about) 1 package docker 2 3 import ( 4 "fmt" 5 "os" 6 ) 7 8 // ExportArtifact is an Artifact implementation for when a container is 9 // exported from docker into a single flat file. 10 type ExportArtifact struct { 11 path string 12 } 13 14 func (*ExportArtifact) BuilderId() string { 15 return BuilderId 16 } 17 18 func (a *ExportArtifact) Files() []string { 19 return []string{a.path} 20 } 21 22 func (*ExportArtifact) Id() string { 23 return "Container" 24 } 25 26 func (a *ExportArtifact) String() string { 27 return fmt.Sprintf("Exported Docker file: %s", a.path) 28 } 29 30 func (a *ExportArtifact) Destroy() error { 31 return os.Remove(a.path) 32 }