-
-
Notifications
You must be signed in to change notification settings - Fork 644
Add docs on how to build your own pre-provisioned base box #1126
Comments
"But 512 K is enough for everybody, right?" /s In all seriousness, though... basically something like "how to build and host your own derivative box" would be a decent addition. Or if not that, at least a blog post, akin to one I did a while back about Packer + Ansible: Building VM images with Ansible and Packer. Or more specifically, how to optimize a project for your team even further than something like Beetbox. |
Thanks for the link! Currently I'm just testing it out by building our boilerplate project together with a post-provision task that runs: #!/bin/bash
rm -f /home/vagrant/.ssh/known_hosts
apt-get clean
dd if=/dev/zero of=/EMPTY bs=1M
rm -f /EMPTY
cat /dev/null > ~/.bash_history config.yml build_composer_project: false
install_site: false
vagrant_synced_folders: []
nginx_hosts: []
apache_vhosts: []
mysql_databases: []
mysql_users: []
postgresql_databases: []
postgresql_users: []
post_provision_scripts:
- "{{ config_dir }}/box-cleanup.sh" And then vagrant package --output mybox.box Everyone at work uses VirtualBox so I guess as a really simple solution, this should work. |
The simple solution works. To make it maintainable I guess I do need packer though. |
For packer I guess the easiest is to fork one of your box repositories and configuring it to run Drupal VM's playbook with the instructions from Deploying Drupal VM to a production environment. @geerlingguy feel free to close this if you think it's better suited as a blog post or in general too far from the common use case. |
Not necessarily... it might still be suited for a blog post, but we can explore the topic in this issue a bit more before closing it out. For months, I've been wanting to do basically what you've suggested:
But make it into a digestible and as-simple-as-possible process so it's really easy for people to do it on their own. It would also alleviate some of my bandwidth, for which I'm now up to about $25/month just to host my boxes 😳 |
@oxyc take a look @ the minimize script in the boxcutter project - https://github.com/boxcutter/ubuntu/blob/master/script/minimize.sh This massively reduced the size of the beetbox base image -- https://atlas.hashicorp.com/beet/boxes/box (was > 800MB) @geerlingguy maybe this could be added to your build? |
Also just to explain where beetbox heading RE: "preprovisioned profiles" which could provide a bunch of preprovisioned base boxes eg. PHP7, Acquia, Platform.sh etc. We've added the concept of a profile which extends the default config so maintenance is reduced. This is set by Maybe even a Centos / RHEL box/container... It's not much overhead to manage as each box is automatically built on a new tag & thanks to Hashicorp we've been sponsored a Vagrant Enterprise account. These profiles could also potentially be set inside |
@thom8 nice thanks for the resources!
Drupal VM's |
@thom8 - The Ansible packer roles for Debian/RHEL do clean up all the packages they installed for configuration (or at least they should), and the minimal base box images are already as close to barebones as I can get them. I think I gave up doing things like removing all man pages and such, just because my base boxes are meant to emulate the actual minimal OS installs, and they still include things like man pages. |
A bit related. But you can now use |
@oxyc this has actually always worked, the difference described in that issue is that all of BLT's default config is now part of the preprovisioning. Even, before the changes it still worked as it would just provision anything that wasn't already included. |
I just didn't think of doing that before you mentioned it in the issue queue. Once linked clones are working again I'll give it a try and see how it compares. |
All good, the reverse is also true
even the default ubuntu
|
One annoyance with With For reference |
@thom8 is that a bug or? |
@oxyc it's just using the default version on atlas -- https://github.com/beetboxvm/beetbox/blob/master/provisioning/ubuntu-16.04.json#L56 I don't use Looks like packer now supports |
Alright, it's a bit annoying with the plugin installed. Checked some more and it's just tied to the installed version of VirtualBox. Guess it's just worked well for me with |
happy to add the latest version to the Atlas build -- beetboxvm/beetbox#446 |
@oxyc looks like it's working with
|
@oxyc pushed Also publishing link to build --> https://github.com/beetboxvm/beetbox/releases/tag/0.8.0 Which should help with any debugging, wish I could make the Atlas build public... but happy to give you access if you're interested |
Also related:
|
I'm going to close this issue and move further work into #1774 — basically to document how the Drupal VM base box is built, and how you can customize that further. |
Issue Type
Summary
My laptop just ran out of space (
71 GiB ~/VirtualBox VMs
) so I thought it might be a good idea to build a pre-provisioned box and leverage linked clones. As Drupal VM is so awesome for teams, might this be something worth adding to the docs?I've never used packer or looked into building boxes, but it looks easy enough and quite useful. I know other co-workers have complained about the VM disk usage..
The text was updated successfully, but these errors were encountered: