Create development environments with Vagrant & Packer
Caution
This project is not actively maintained and may or may not actively function as described. You will find my current shell setup here and my current dev environment (using containers) here 🤓
-
Vagrant is a high-level wrapper API for kernel-based virtual machines (KVM). Vagrant uses packaged environments called boxes and allows one to manage, configure, and control virtual environments with code and automation.
-
Packer enables one to create Vagrant boxes (and other things) via an automated and repeatable process driven by a single JSON-formatted template file.
- Virtualbox is installed
- Vagrant is installed
- Packer is installed
Warning: Internet connection is required
- Open up a command prompt (or Git bash)
- Create and enter a new directory:
mkdir path/to/dev/dir && cd path/to/dev/dir
- Initialize a Vagrantfile and start your Vagrant box:
vagrant init jhwohlgemuth/env && vagrant up
See the Vagrant Getting Started guide for more information
The default jhwohlgemuth/env
Vagrant box hosted on Atlas,
includes the ~/.jhwohlgemuth
directory that has some useful files.
~/.jhwohlgemuth/setup.sh
is a collection of tweaks and customizations.
usage:
#setup.sh is executable and can be run with just:
~/.jhwohlgemuth/setup.sh
~/.jhwohlgemuth/functions.sh
is a collection of functions for installing and configuring software.
usage:
#Most functions require root privileges
sudo -s
#Functions are sourced when terminal is opened
#Type 'install_' followed by tab to see the available install functions
#Type 'setup_' followed by tab to see the available setup functions
Warning: Internet connection is required
Warning: This sections requires that Packer is installed
Warning: An Atlas token is not required for box creation, but not having one set will cause the
atlas
post-provisioner to fail.
- Clone this repo with
git clone https://github.com/jhwohlgemuth/env.git
- Customize
packer.json
and the provisioning scripts to your liking - Open up a Git bash in the root directory:
#Set token for connecting to Atlas
export ATLAS_TOKEN=<your secret token>
#Validate Packer template and fix errors if applicable
packer validate packer.json
#Start the build process. Go get a coffee.
packer build packer.json
See the official Packer Introduction for more information