github.com/raghuse92/packer@v1.3.2/post-processor/vagrant/docker.go (about) 1 package vagrant 2 3 import ( 4 "fmt" 5 6 "github.com/hashicorp/packer/packer" 7 ) 8 9 type DockerProvider struct{} 10 11 func (p *DockerProvider) KeepInputArtifact() bool { 12 return false 13 } 14 15 func (p *DockerProvider) Process(ui packer.Ui, artifact packer.Artifact, dir string) (vagrantfile string, metadata map[string]interface{}, err error) { 16 // Create the metadata 17 metadata = map[string]interface{}{"provider": "docker"} 18 19 vagrantfile = fmt.Sprintf(dockerVagrantfile, artifact.Id()) 20 return 21 } 22 23 var dockerVagrantfile = ` 24 Vagrant.configure("2") do |config| 25 config.vm.provider :docker do |docker, override| 26 docker.image = "%s" 27 end 28 end 29 `