github.com/askholme/packer@v0.7.2-0.20140924152349-70d9566a6852/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 or any of its built-in providers, 82 you'll first need [Go](http://www.golang.org) installed (version 1.2+ is 83 _required_). Make sure Go is properly installed, including setting up 84 a [GOPATH](http://golang.org/doc/code.html#GOPATH). 85 86 Next, install the following software packages, which are needed for some dependencies: 87 88 - [Bazaar](http://bazaar.canonical.com/en/) 89 - [Git](http://git-scm.com/) 90 - [Mercurial](http://mercurial.selenic.com/) 91 92 Then, install [Gox](https://github.com/mitchellh/gox), which is used 93 as a compilation tool on top of Go: 94 95 $ go get -u github.com/mitchellh/gox 96 97 Next, clone this repository into `$GOPATH/src/github.com/mitchellh/packer`. 98 Install the necessary dependencies by running `make updatedeps` and then just 99 type `make`. This will compile some more dependencies and then run the tests. If 100 this exits with exit status 0, then everything is working! 101 102 $ make updatedeps 103 ... 104 $ make 105 ... 106 107 To compile a development version of Packer and the built-in plugins, 108 run `make dev`. This will put Packer binaries in the `bin` folder: 109 110 $ make dev 111 ... 112 $ bin/packer 113 ... 114 115 116 If you're developing a specific package, you can run tests for just that 117 package by specifying the `TEST` variable. For example below, only 118 `packer` package tests will be run. 119 120 $ make test TEST=./packer 121 ...