Git Product home page Git Product logo

machine-images's Introduction

Packer

Packer (http://packer.io) is an open source tool for creating machine images.

We use Packer to create Amazon Machine Images (AMIs) from which our EC2 instances will be launched.

Installation

Instructions here: http://www.packer.io/docs/installation.html

Usage

To build an AMI, make sure your keys are set:

$ export AWS_ACCESS_KEY_ID="<your_access_key>"
$ export AWS_SECRET_ACCESS_KEY="<your_secret_key>"

Then, cd into the target image build directory and run packer build <machine_template>:

$ cd ubuntu-12.04-docker/
$ packer build packer.json

Build times are typically 5-15 minutes, and you should see streamed output like this:

$ packer build packer.json 
amazon-ebs output will be in this color.

==> amazon-ebs: Creating temporary keypair: packer 53331748-f8b0-34c5-6f92-527505860627
==> amazon-ebs: Creating temporary security group for this instance...
==> amazon-ebs: Authorizing SSH access on the temporary security group...
==> amazon-ebs: Launching a source AWS instance...
    amazon-ebs: Instance ID: i-1278911a
==> amazon-ebs: Waiting for instance (i-1278911a) to become ready...
==> amazon-ebs: Waiting for SSH to become available...
==> amazon-ebs: Connected to SSH!
==> amazon-ebs: Provisioning with shell script: packer.sh
    amazon-ebs: Hit http://archive.ubuntu.com precise Release.gpg
    amazon-ebs: Get:1 http://archive.ubuntu.com precise-updates Release.gpg [198 B]
    amazon-ebs: Hit http://archive.ubuntu.com precise Release
[... REMOVED FOR BREVITY ...]
    amazon-ebs: Setting up git-man (1:1.7.9.5-1) ...
    amazon-ebs: Setting up git (1:1.7.9.5-1) ...
    amazon-ebs: Setting up lxc-docker-0.9.1 (0.9.1) ...
    amazon-ebs: docker start/running, process 11097
    amazon-ebs: Setting up lxc-docker (0.9.1) ...
    amazon-ebs: Processing triggers for libc-bin ...
    amazon-ebs: ldconfig deferred processing now taking place
==> amazon-ebs: Stopping the source instance...
==> amazon-ebs: Waiting for the instance to stop...
==> amazon-ebs: Creating the AMI: ubuntu-12.04-docker-2014-03-26T18-07-04Z
    amazon-ebs: AMI: ami-863b53b6
==> amazon-ebs: Waiting for AMI to become ready...
==> amazon-ebs: Adding tags to AMI (ami-863b53b6)...
    amazon-ebs: Adding tag: "OS_Flavor": "Ubuntu"
    amazon-ebs: Adding tag: "OS_Version": "12.04 LTS"
==> amazon-ebs: Terminating the source AWS instance...
==> amazon-ebs: Deleting temporary security group...
==> amazon-ebs: Deleting temporary keypair...
Build 'amazon-ebs' finished.

==> Builds finished. The artifacts of successful builds are:
--> amazon-ebs: AMIs were created:

us-west-2: ami-863b53b6

To copy the AMI to another region, just use the AWS Console or awscli:

$ aws ec2 copy-image --source-image-id ami-863b53b6 --source-region us-west-2 --region us-east-1

machine-images's People

Contributors

mbabineau avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.