Questions tagged [packer]

PACKER QUESTIONS MUST BE PROGRAMMING RELATED. Packer is a tool for creating identical machine images for multiple platforms from a single source configuration.

"Packer is a modern tool that embraces best benefits. It's completely automated, simply run a packer build, no human touches it, Packer builds it for you. " - Mitchell Hashimoto (Creator)

Packer is an open source tool for creating 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 does not replace configuration management like Chef or Puppet. In fact, when building images, Packer is able to use tools like Chef or Puppet to install software onto the image.

A machine image is a single static unit that contains a pre-configured operating system and installed software which is used to quickly create new running machines. Machine image formats change for each platform. Some examples include AMIs for EC2, VMDK/VMX files for VMware, OVF exports for VirtualBox, etc.

Resources

852 questions
69
votes
3 answers

How are Packer and Docker different? Which one should I prefer when provisioning images?

How are Packer and Docker different? Which one is easier/quickest to provision/maintain and why? What is the pros and cons of having a dockerfile?
Abhineetraj
  • 769
  • 1
  • 5
  • 9
63
votes
5 answers

"Resource not accessible by integration" on github post /repos/{owner}/{repo}/actions/runners/registration-token API

I am making a curl post request from my github workflow (action) to get registration token for a self-hosted runner but I am receiving the following response: { "message": "Resource not accessible by integration", "documentation_url":…
nu_popli
  • 920
  • 1
  • 7
  • 12
45
votes
2 answers

Convert Amazon EC2 AMI to Virtual or Vagrant box

I'd like to copy the disk image of a running EC2 instance (grab the AMI) and import it into virtual box or eventually have it run using Vagrant. I saw that packer (http://www.packer.io/) allows you to create AMI's and corresponding Vagrant boxes to…
Justin W.
  • 908
  • 1
  • 10
  • 9
26
votes
2 answers

When to provision in Packer vs Terraform?

I am sitting with a situation where I need to provision EC2 instances with some packages on startup. There are a couple of (enterprise/corporate) constraints that exist: I need to provision on top of a specific AMI, which adds enterprisey stuff…
Shiraaz.M
  • 3,073
  • 2
  • 24
  • 40
22
votes
4 answers

How can I chain packer output ami id to terraform variables automatically?

I'm using packer with ansible provisioner to build an ami, and terraform to setup the infrastructure with that ami as a source - somewhat similar to this article:…
fips
  • 4,319
  • 5
  • 26
  • 42
21
votes
2 answers

How to pass argument in packer provision script?

I am struggling to pass input parameter to packer provisioning script. I have tried various options but no joy. Objective is my provision.sh should accept input parameter which I send during packer build. packer build -var role=abc test.json I am…
Thayz
  • 631
  • 1
  • 6
  • 9
19
votes
2 answers

Docker image format

I would like to build a Docker image without docker itself. I have looked at [Packer](http://www.packer.io/docs/builders/docker.html, but it requires that Docker be installed on the builder host. I have looked at the Docker Registry API…
errordeveloper
  • 6,716
  • 6
  • 41
  • 54
18
votes
3 answers

How can I convert a Docker image into a (vagrant) VirtualBox box?

I've been looking at Packer.io, and would love to use it to provision/prepare the vagrant (VirtualBox) boxes used by our developers. I know I could build the boxes with VirtualBox using the VirtualBox Packer builder, but find the layer stacking of…
Fredrik Wendt
  • 988
  • 1
  • 10
  • 17
17
votes
2 answers

What to bake into an AWS AMI and what to provision using cloud-init?

I'm using AWS Cloudformation to setup numerous elements of network infrastructure (VPCs, SecurityGroups, Subnets, Autoscaling groups, etc) for my web application. I want the whole process to be automated. I want click a button and be able to fire up…
Saqib Ali
  • 11,931
  • 41
  • 133
  • 272
15
votes
2 answers

Packer build fails due to tty needed for sudo

My packer build is failing with the following message: sudo: sorry, you must have a tty to run sudo. My host is Windows 8 with vagrant and virtualbox, my guest is centos7. On researching it is my understanding that not requiring tty for sudo is the…
Harris.Atlarge
  • 171
  • 1
  • 1
  • 5
15
votes
2 answers

Having trouble creating a basic AWS AMI with Packer.io. SSH Timeout

I'm trying to follow these instructions to build a basic AWS image using Packer.io. But it is not working for me. Here is my Template file: { "variables": { "aws_access_key": "", "aws_secret_key": "" }, "builders": [{ "type":…
Saqib Ali
  • 11,931
  • 41
  • 133
  • 272
14
votes
3 answers

AWS user_data with Packer

So I'm trying to use Packer to create an AWS image and specify some user data via user_data_file. The contents of this file needs to be run when the instance boots as it will be unique each time. I can't bake this into the AMI. Using packer I have…
David Ficociello
  • 2,489
  • 5
  • 15
  • 21
13
votes
4 answers

Packer can't execute shell provisioner as sudo

I have a shell provisioner in packer connected to a box with user vagrant { "environment_vars": [ "HOME_DIR=/home/vagrant" ], "expect_disconnect": true, "scripts": [ "scripts/foo.sh" ], "type": "shell" } where the content of the…
Georg Heiler
  • 16,916
  • 36
  • 162
  • 292
12
votes
4 answers

How to use user variables with file provisioner in Packer?

I have a packer json like: "builders": [{...}], "provisioners": [ { "type": "file", "source": "packer/myfile.json", "destination": "/tmp/myfile.json" } ], "variables": { …
MarMan
  • 328
  • 2
  • 3
  • 9
12
votes
3 answers

debconf: unable to initialize frontend: Dialog

I am building my own ubuntu VM with packer to host on Atlas and I'm using the packer build template.json to test if it will be a success if I was to use packer push template.json I am getting this error when the I run the mysql.sh…
Rudy Jessop
  • 872
  • 1
  • 11
  • 23
1
2 3
56 57