From 1781d352a5ba2193d89fa780719eb2dc10f69a79 Mon Sep 17 00:00:00 2001 From: Patrick Double Date: Mon, 16 Jul 2018 15:35:02 -0500 Subject: [PATCH] Add Vagrantfile fragment with docker tag specified --- post-processor/vagrant/docker.go | 5 ++++- post-processor/vagrant/post-processor.go | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/post-processor/vagrant/docker.go b/post-processor/vagrant/docker.go index 50b811c8f..6f5aeb3dc 100644 --- a/post-processor/vagrant/docker.go +++ b/post-processor/vagrant/docker.go @@ -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 ` diff --git a/post-processor/vagrant/post-processor.go b/post-processor/vagrant/post-processor.go index 3d54d49f7..1aab0ca23 100644 --- a/post-processor/vagrant/post-processor.go +++ b/post-processor/vagrant/post-processor.go @@ -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 {