Packer - Build d'images (VMs, containers, ISOs)
Find a file
2020-05-13 13:49:19 +02:00
.circleci replace AZR token with a CI one (#9195) 2020-05-11 11:21:30 +02:00
.github
builder builder/amazon Fix invalid pointer issue for non SSMAgengtEnabled builds 2020-05-12 14:49:57 -04:00
cmd remove unused import 2020-05-01 10:36:17 -07:00
command Merge pull request #9124 from GennadySpb/yandex-export-post-processor 2020-05-05 11:01:13 -07:00
common Add pwd to gogetter ChecksumFromFile (#9129) 2020-05-11 11:14:50 +02:00
communicator
contrib
examples
fix update consul and vault dependencies (#9205) 2020-05-11 15:26:01 -04:00
hcl2template teach HCL mode builds to honor -only and -except options (#8947) 2020-04-28 15:03:24 +02:00
helper add undocumented tag to struct-markdown generator so that we can leave internal-use-only fields out of docs 2020-05-01 10:31:38 -07:00
packer Add RetriedProvisioner to allow retry provisioners (#9061) 2020-04-16 11:58:54 +02:00
plugin/example
post-processor Merge pull request #9105 from hashicorp/google_iap 2020-05-08 12:40:42 -07:00
provisioner provisioner/windows-shell: remove unused testObjects() (#9116) 2020-04-27 10:50:31 +02:00
scripts slow down the changelog script to prevent rate limiting (#9172) 2020-05-05 20:22:25 -04:00
template update consul and vault dependencies (#9205) 2020-05-11 15:26:01 -04:00
test
vendor update consul and vault dependencies (#9205) 2020-05-11 15:26:01 -04:00
version update to v1.6.0-dev 2020-05-01 15:45:34 -07:00
website website: npm audit fix (#9218) 2020-05-13 13:49:19 +02:00
.codecov.yml
.gitattributes
.gitignore
.golangci.yml
.hashibot.hcl
background_check.go
background_check_openbsd.go
CHANGELOG.md update changelog 2020-05-12 16:50:26 -07:00
checkpoint.go
CODEOWNERS Add CHANGELOG record 2020-04-27 02:33:08 +03:00
commands.go
config.go
config_test.go
Dockerfile
go.mod update consul and vault dependencies (#9205) 2020-05-11 15:26:01 -04:00
go.sum update consul and vault dependencies (#9205) 2020-05-11 15:26:01 -04:00
LICENSE
log.go
main.go
main_test.go
Makefile
panic.go
README.md
tty.go
tty_solaris.go
Vagrantfile

Packer

Build Status Windows Build Status GoDoc GoReportCard codecov

Packer is a tool for building identical machine images for multiple platforms from a single source configuration.

Packer is lightweight, runs on every major operating system, and is highly performant, creating machine images for multiple platforms in parallel. Packer comes out of the box with support for many platforms, the full list of which can be found at https://www.packer.io/docs/builders/index.html.

Support for other platforms can be added via plugins.

The images that Packer creates can easily be turned into Vagrant boxes.

Quick Start

Note: There is a great introduction and getting started guide for those with a bit more patience. Otherwise, the quick start below will get you up and running quickly, at the sacrifice of not explaining some key points.

First, download a pre-built Packer binary for your operating system or compile Packer yourself.

After Packer is installed, create your first template, which tells Packer what platforms to build images for and how you want to build them. In our case, we'll create a simple AMI that has Redis pre-installed. Save this file as quick-start.json. Export your AWS credentials as the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables.

{
  "variables": {
    "access_key": "{{env `AWS_ACCESS_KEY_ID`}}",
    "secret_key": "{{env `AWS_SECRET_ACCESS_KEY`}}"
  },
  "builders": [{
    "type": "amazon-ebs",
    "access_key": "{{user `access_key`}}",
    "secret_key": "{{user `secret_key`}}",
    "region": "us-east-1",
    "source_ami": "ami-af22d9b9",
    "instance_type": "t2.micro",
    "ssh_username": "ubuntu",
    "ami_name": "packer-example {{timestamp}}"
  }]
}

Next, tell Packer to build the image:

$ packer build quick-start.json
...

Packer will build an AMI according to the "quick-start" template. The AMI will be available in your AWS account. To delete the AMI, you must manually delete it using the AWS console. Packer builds your images, it does not manage their lifecycle. Where they go, how they're run, etc., is up to you.

Documentation

Comprehensive documentation is viewable on the Packer website:

https://www.packer.io/docs

Developing Packer

See CONTRIBUTING.md for best practices and instructions on setting up your development environment to work on Packer.