File: artifact_export.go

package info (click to toggle)
packer 0.10.2%2Bdfsg-6
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,728 kB
  • ctags: 4,626
  • sloc: sh: 321; makefile: 73
file content (36 lines) | stat: -rw-r--r-- 650 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package docker

import (
	"fmt"
	"os"
)

// ExportArtifact is an Artifact implementation for when a container is
// exported from docker into a single flat file.
type ExportArtifact struct {
	path string
}

func (*ExportArtifact) BuilderId() string {
	return BuilderId
}

func (a *ExportArtifact) Files() []string {
	return []string{a.path}
}

func (*ExportArtifact) Id() string {
	return "Container"
}

func (a *ExportArtifact) String() string {
	return fmt.Sprintf("Exported Docker file: %s", a.path)
}

func (a *ExportArtifact) State(name string) interface{} {
	return nil
}

func (a *ExportArtifact) Destroy() error {
	return os.Remove(a.path)
}