github.com/sneal/packer@v0.5.2/builder/docker/artifact_import.go (about)

     1  package docker
     2  
     3  import (
     4  	"fmt"
     5  )
     6  
     7  // ImportArtifact is an Artifact implementation for when a container is
     8  // exported from docker into a single flat file.
     9  type ImportArtifact struct {
    10  	BuilderIdValue string
    11  	Driver         Driver
    12  	IdValue        string
    13  }
    14  
    15  func (a *ImportArtifact) BuilderId() string {
    16  	return a.BuilderIdValue
    17  }
    18  
    19  func (*ImportArtifact) Files() []string {
    20  	return nil
    21  }
    22  
    23  func (a *ImportArtifact) Id() string {
    24  	return a.IdValue
    25  }
    26  
    27  func (a *ImportArtifact) String() string {
    28  	return fmt.Sprintf("Imported Docker image: %s", a.Id())
    29  }
    30  
    31  func (a *ImportArtifact) Destroy() error {
    32  	return a.Driver.DeleteImage(a.Id())
    33  }