Go to file
Adrien Delorme 8930c4b913 duplicate space 2020-06-16 16:55:58 +02:00
.circleci Interpolate generatedData in the Inspec provisioner (#9262) 2020-05-20 15:43:41 -04:00
.github .github/workflows/issues: Add milestone labeling action 2020-06-10 15:10:48 -04:00
builder Merge pull request #9406 from hashicorp/fix_9084 2020-06-15 15:55:54 -07:00
cmd appease linter 2020-05-29 09:40:31 -07:00
command Skip consecutives post-processors 2020-06-09 17:35:53 +02:00
common adds missing special char to the list 2020-06-12 15:17:41 +02:00
communicator show a better error message in ssh.scpSession (#9217) 2020-05-13 15:57:05 +02:00
contrib
examples builder/hyperone: Add examples for HCL syntax 2020-05-19 01:20:25 +02:00
fix Refactor communicator config for Qemu and add SkipNatMapping option (#9307) 2020-06-02 11:56:36 +02:00
hcl2template Skip consecutives post-processors 2020-06-09 17:35:53 +02:00
helper command/validate: Add support for HCL2 configuration files 2020-06-05 14:24:39 -04:00
packer Skip consecutives post-processors 2020-06-09 17:35:53 +02:00
plugin/example
post-processor Merge pull request #9379 from GennadySpb/sa-auth-in-yandex-export 2020-06-10 09:40:02 -07:00
provisioner Revert "Merge pull request #9040 from hashicorp/powershell-exit-code-fix-4916" 2020-06-09 11:41:07 -04:00
scripts ignore website label to prepare_changelog.sh (#9422) 2020-06-15 11:25:45 +02:00
template remove outdated comment 2020-05-29 09:43:31 -07:00
test builder/hyperone: Add tests for HCL syntax 2020-05-19 01:21:00 +02:00
vendor upgrade linodego to v0.14.0 (#9395) 2020-06-12 11:36:54 +02:00
version Putting source back into Dev Mode 2020-06-09 21:15:36 +00:00
website duplicate space 2020-06-16 16:55:58 +02:00
.codecov.yml remove codecov status (#9225) 2020-05-14 16:02:51 +02:00
.gitattributes clean up documentation for new NIC and storage params 2020-04-13 14:28:50 -04:00
.gitignore
.golangci.yml
.hashibot.hcl update hashibot config not to comment when locking super old and stale issues 2020-04-03 11:37:34 -07:00
CHANGELOG.md update changelog 2020-06-15 16:30:01 -07:00
CODEOWNERS Add CODEOWNERS of bats tests (#9259) 2020-05-19 15:05:57 -04:00
Dockerfile
LICENSE
Makefile make generate: don't error when find does not find any file (#9413) 2020-06-12 16:30:44 +02:00
README.md Add Codecov badge and remove report style (#8896) 2020-03-16 15:59:55 +01:00
Vagrantfile
background_check.go
background_check_openbsd.go
checkpoint.go
commands.go
config.go
config_test.go
go.mod remove replace git.apache.org/thrift.git call (#8909) 2020-06-12 13:03:30 +02:00
go.sum remove replace git.apache.org/thrift.git call (#8909) 2020-06-12 13:03:30 +02:00
log.go
main.go enable force, debug, and on-error for hcl2 builds 2020-05-14 16:22:51 -07:00
main_test.go
panic.go
tty.go
tty_solaris.go

README.md

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.