- All about Vagrant and the good stuff by HashiCorp !
- Catalogs: 1 & 2
- Ensure the following are installed
- Initialize with a default stable
Vagrantfile
and bring up the VM:Note: 'vagrant box add' step is optional, when using a template from HashiCorp Atlas sitecd scratch-area vagrant box add hashicorp/precise64 http://files.vagrantup.com/precise64.box vagrant init hashicorp/precise64 vagrant up
Sample Dev Box w/ a web-server(e.g. when you need a dev env with JDK & Jetty in it):
What were the key steps executed to construct this box:
- Give a name to the VM
- Open and map the required port (80:8080) between host & guest OS
- Provision a SHELL to download & bring up Jetty
cd jetty
vagrant up
Command | Purpose |
---|---|
vagrant up | Create new or bring up an existing VM |
vagrant status | Check status |
vagrant halt | Suspend (Graceful Shutdown) |
vagrant destroy | Destroy VM |
vagrant reload | Bounce VM |
vagrant box list | Print the list of all templates (aka vagrant boxes) present in your machine |
vagrant box add <title> | Add new base box |
vagrant box update | Update the box to latest version available |
vagrant provision | Run the provisioner mentioned in Vagrantfile, while the VM is up & running |