2014-01-19 22:48:06 -05:00
|
|
|
package docker
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
)
|
|
|
|
|
|
|
|
// ImportArtifact is an Artifact implementation for when a container is
|
|
|
|
// exported from docker into a single flat file.
|
|
|
|
type ImportArtifact struct {
|
|
|
|
BuilderIdValue string
|
|
|
|
Driver Driver
|
|
|
|
IdValue string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (a *ImportArtifact) BuilderId() string {
|
|
|
|
return a.BuilderIdValue
|
|
|
|
}
|
|
|
|
|
|
|
|
func (*ImportArtifact) Files() []string {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (a *ImportArtifact) Id() string {
|
|
|
|
return a.IdValue
|
|
|
|
}
|
|
|
|
|
|
|
|
func (a *ImportArtifact) String() string {
|
|
|
|
return fmt.Sprintf("Imported Docker image: %s", a.Id())
|
|
|
|
}
|
|
|
|
|
2014-01-19 13:32:44 -05:00
|
|
|
func (*ImportArtifact) State(name string) interface{} {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2014-01-19 22:48:06 -05:00
|
|
|
func (a *ImportArtifact) Destroy() error {
|
|
|
|
return a.Driver.DeleteImage(a.Id())
|
|
|
|
}
|