Add Vagrantfile fragment with docker tag specified

This commit is contained in:
Patrick Double 2018-07-16 15:35:02 -05:00
parent e7fc651f60
commit 1781d352a5
2 changed files with 6 additions and 1 deletions

View File

@ -16,11 +16,14 @@ func (p *DockerProvider) Process(ui packer.Ui, artifact packer.Artifact, dir str
// Create the metadata
metadata = map[string]interface{}{"provider": "docker"}
vagrantfile = fmt.Sprintf(dockerVagrantfile)
vagrantfile = fmt.Sprintf(dockerVagrantfile, artifact.Id())
return
}
var dockerVagrantfile = `
Vagrant.configure("2") do |config|
config.vm.provider :docker do |docker, override|
docker.image = "%s"
end
end
`

View File

@ -32,6 +32,8 @@ var builtins = map[string]string{
"transcend.qemu": "libvirt",
"ustream.lxc": "lxc",
"packer.post-processor.docker-import": "docker",
"packer.post-processor.docker-tag": "docker",
"packer.post-processor.docker-push": "docker",
}
type Config struct {