How do I build Vagrant boxes that are based on other Vagrant boxes?

10 views
Skip to first unread message

Jason Hsu

unread,
Apr 12, 2019, 11:16:48 PM4/12/19
to Packer
I've used Packer to build Vagrant boxes from scratch, starting from a Debian Linux ISO.

Is there a way to build Vagrant boxes by starting with an existing Vagrant box instead of doing it from scratch?  For example, how would I build a box based on the generic/debian9 box available from Vagrant Cloud?  In the Docker world, the Dockerfile plays the same role that the *.json file does in Packer.  If you want to build a Docker image based on Debian Stretch, your Dockerfile would start with "FROM debian:stretch".  If you want to build a Docker image based on my minimal Debian Stretch image, your Dockerfile would start with "FROM rubyonracetracks/debian-stretch-min".

Rickard von Essen

unread,
Apr 13, 2019, 3:11:51 AM4/13/19
to packe...@googlegroups.com
There is a new Vagrant builder that can build from existing vagrant boxes. It has the limitation that the vagrant provider needs to implement package.

You can also use the other packer builder and build from a existing vagrant box if you extract the image from the source box and use the vagrant post-processor to again package it as a vagrant box. 

On Sat, Apr 13, 2019, 05:16 Jason Hsu <jhsu8...@gmail.com> wrote:
I've used Packer to build Vagrant boxes from scratch, starting from a Debian Linux ISO.

Is there a way to build Vagrant boxes by starting with an existing Vagrant box instead of doing it from scratch?  For example, how would I build a box based on the generic/debian9 box available from Vagrant Cloud?  In the Docker world, the Dockerfile plays the same role that the *.json file does in Packer.  If you want to build a Docker image based on Debian Stretch, your Dockerfile would start with "FROM debian:stretch".  If you want to build a Docker image based on my minimal Debian Stretch image, your Dockerfile would start with "FROM rubyonracetracks/debian-stretch-min".

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/3bc85222-f26c-4578-8bca-e0509be38ab1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages