hashicorp / hashicorp/vagrant

vagrant package: Override, do not reset Vagrantfile's

Open
#10,941 0 comments 0 reactions 0 assignees View on GitHub
core enhancement
Dominant language
Ruby
Stars
27.2k
Forks
4.4k
Avg merge
1m
Merged PRs (30d)
1

Description

Many operating systems require intensive Vagrantfile customizations in order to boot properly. However, these customizations are often dropped on `vagrant package`, so people often upload partially working boxes that later break when extended.

As a workaround, developers must remember to explicitly copy and paste critical snippets across boxes. I have a habit of writing `export.Vagrantfile`s with my projects, and including this as part of my .BOX output.

However, this only works for the adjacent `vagrant package` descendant box, not any further `vagrant package`d boxes further downstream. I wouldn't expect many Vagrant users to think to do this step when preparing boxes. And I myself frequently forget to do this, resulting in plenty of items on Vagrant Cloud that break when extended.

Furthermore, the way that Vagrant streams files into the final .BOX compressed archive, does not make use of concatenating compression. This means that if you do maintain a careful discipline of providing matching `[export.]Vagrantfile`s every time you publish a box, the `vagrant package` command takes substantially longer to complete.

I don't know enough about the details of Vagrant box compression, but I suspect ZIP may play a role in that. For what it's worth, GZIP compression definitely allows appending files to an existing compressed archive stream handle, and in the interest of performance we should start making use of it.

Anyhoo, I'd love to see the next major Vagrantfile version append rather than erase the parent's Vagrantfile chain, to make sure that any complicated base boxes, can be extended and customized down as many boxes as people require for their work. Kind of how Docker images append configuration in layers rather than reset configuration.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.