Packer: 1 command line to create a Debian VirtualBox/Vagrant box

| 0 comments

0.00 avg. rating (0% score) - 0 votes

packer_logo

I recently wanted to update my Vagrant box running Debian Wheezy. The problem is, the box size is growing on each updates for several reasons. And I prefer to create a new box from scratch on any new Debian release.

Starting from scratch each time is a little bit boring, that’s why I created a preseed file (french). That made the install automatically, however I always had to do other step by hands (or need to write a script for it).

I remembered to have tested Packer a few times ago and decided to look at the features of the latest version.
The last one is good enough to make all I needed. So I started to write a Packer configuration file (on GitHub) and now I can build a Vagrant box ready in a few minutes in only one command!

Do you want to see? First clone the repository:

Then edit deimosfr_debian-wheezy file and adapt the variables fields with the Debian version you want and the ISO sha512 checksum:

Once done, create your box file:

That’s it 🙂

You can find the result on the vagrantcloud here if you only want to get the version built with it: https://vagrantcloud.com/deimosfr/debian-wheezy

Thanks HashiCorp for Vagrant and Packer 🙂

Author: Deimos

I'm a passionate DevOps. I love transmit my skills and I love working on high availability infrastructures/technologies.

Laisser une réponse