github.com/tonnydourado/packer@v0.6.1-0.20140701134019-5d0cd9676a37/README.md (about) 1 # Packer 2 3 * Website: http://www.packer.io 4 * IRC: `#packer-tool` on Freenode 5 * Mailing list: [Google Groups](http://groups.google.com/group/packer-tool) 6 7 Packer is a tool for building identical machine images for multiple platforms 8 from a single source configuration. 9 10 Packer is lightweight, runs on every major operating system, and is highly 11 performant, creating machine images for multiple platforms in parallel. 12 Packer comes out of the box with support for the following platforms: 13 * Amazon EC2 (AMI). Both EBS-backed and instance-store AMIs 14 * DigitalOcean 15 * Docker 16 * Google Compute Engine 17 * OpenStack 18 * Parallels 19 * QEMU. Both KVM and Xen images. 20 * VirtualBox 21 * VMware 22 23 Support for other platforms can be added via plugins. 24 25 The images that Packer creates can easily be turned into 26 [Vagrant](http://www.vagrantup.com) boxes. 27 28 ## Quick Start 29 30 **Note:** There is a great 31 [introduction and getting started guide](http://www.packer.io/intro) 32 for those with a bit more patience. Otherwise, the quick start below 33 will get you up and running quickly, at the sacrifice of not explaining some 34 key points. 35 36 First, [download a pre-built Packer binary](http://www.packer.io/downloads.html) 37 for your operating system or [compile Packer yourself](#developing-packer). 38 39 After Packer is installed, create your first template, which tells Packer 40 what platforms to build images for and how you want to build them. In our 41 case, we'll create a simple AMI that has Redis pre-installed. Save this 42 file as `quick-start.json`. Be sure to replace any credentials with your 43 own. 44 45 ```json 46 { 47 "builders": [{ 48 "type": "amazon-ebs", 49 "access_key": "YOUR KEY HERE", 50 "secret_key": "YOUR SECRET KEY HERE", 51 "region": "us-east-1", 52 "source_ami": "ami-de0d9eb7", 53 "instance_type": "t1.micro", 54 "ssh_username": "ubuntu", 55 "ami_name": "packer-example {{timestamp}}" 56 }] 57 } 58 ``` 59 60 Next, tell Packer to build the image: 61 62 ``` 63 $ packer build quick-start.json 64 ... 65 ``` 66 67 Packer will build an AMI according to the "quick-start" template. The AMI 68 will be available in your AWS account. To delete the AMI, you must manually 69 delete it using the [AWS console](https://console.aws.amazon.com/). Packer 70 builds your images, it does not manage their lifecycle. Where they go, how 71 they're run, etc. is up to you. 72 73 ## Documentation 74 75 Full, comprehensive documentation is viewable on the Packer website: 76 77 http://www.packer.io/docs 78 79 ## Developing Packer 80 81 If you wish to work on Packer itself, you'll first need [Go](http://golang.org) 82 installed (version 1.2+ is _required_). Make sure you have Go properly installed, 83 including setting up your [GOPATH](http://golang.org/doc/code.html#GOPATH). 84 85 For some additional dependencies, Go needs [Mercurial](http://mercurial.selenic.com/) 86 and [Bazaar](http://bazaar.canonical.com/en/) to be installed. 87 Packer itself doesn't require these, but a dependency of a dependency does. 88 89 You'll also need [`gox`](https://github.com/mitchellh/gox) 90 to compile packer. You can install that with: 91 92 ``` 93 $ go get -u github.com/mitchellh/gox 94 ``` 95 96 Next, clone this repository into `$GOPATH/src/github.com/mitchellh/packer` and 97 then just type `make`. In a few moments, you'll have a working `packer` executable: 98 99 ``` 100 $ make 101 ... 102 $ bin/packer 103 ... 104 ``` 105 106 If you need to cross-compile Packer for other platforms, take a look at 107 `scripts/dist.sh`. 108 109 You can run tests by typing `make test`. 110 111 This will run tests for Packer core along with all the core builders and commands and such that come with Packer. 112 113 If you make any changes to the code, run `make format` in order to automatically 114 format the code according to Go standards. 115 116 When new dependencies are added to packer you can use `make updatedeps` to 117 get the latest and subsequently use `make` to compile and generate the `packer` binary.