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
2
votes
1 answer

Packer Unable to attach EBS Volume

I am trying to attach additional volume to my ami, this is my builder section, "launch_block_device_mappings": [ { "device_name": "/dev/sda1", "volume_size": 8, "volume_type": "gp2", "delete_on_termination": true }, …
2
votes
1 answer

Default packer builder without using -only option

I have multiple builders section in my packer template, by default this builds both builder on the cloud provider at the same time. However, if I want to build only the "amazon-ebs" type on the cloud, and use "docker" type locally I can get this…
askb
  • 6,501
  • 30
  • 43
2
votes
1 answer

Pack + AWS + Ansible + Windows are not WORK?

I want to make AMI file from packer and ansible. I have tried many configuration, but I have still a problem of connection to the instance. Here is my packer conf: { "variables": { "aws_access_key": "{{env `AWS_ACCESS_KEY_ID`}}", …
2
votes
1 answer

Packer user variables from script

I have a number of variables that can be populated from bash queries on execution. I'm struggling to find a way to make this a reality. Essentially, I'm trying to accomplish this: { "variables": { "ssh_name": "root", "ssh_pass":…
NickS
  • 23
  • 2
2
votes
1 answer

Cyclic dependency between Packer and Terraform for non-default VPC

My deployment workflow is first creating ami with Packer, then deploy using Terraform. I have a EC2-class, which was created before 2013, so there's no default VPC configured. When I run packer build packer.json, the tool complains that …
janetsmith
  • 8,562
  • 11
  • 58
  • 76
2
votes
2 answers

How to create a new packer image from an existing private packer image in Azure

I'm creating a packer image using these two links: https://www.packer.io/docs/builders/azure.html https://learn.microsoft.com/en-us/azure/virtual-machines/linux/build-image-with-packer I want to use a 'private image' rather than a marketplace image…
James Liu
  • 196
  • 1
  • 2
  • 10
2
votes
0 answers

Packer: Build 'openstack' errored: Timeout waiting for WinRM

I am trying to create a windows image in Openstack cloud using Packer. The VM is getting created successfully but the packer build is getting hanged for quite long period(30 mins) and finally throws "ui error: Build 'openstack' errored: Timeout…
2
votes
0 answers

How to execute a script on packer build failure?

In my current template.json, I am executing a number of scripts with the shell provisioner. For example: { "type": "shell", "scripts": [ "scriptA.sh", "scriptB.sh" ] }, { "type": "shell", "scripts": [ …
bigbaeng
  • 65
  • 1
  • 8
2
votes
4 answers

Packer azure-arm: Cannot locate the managed image resource group

I am new to Packer and I have been trying to build my first packer on Azure image following this guide - https://learn.microsoft.com/en-us/azure/virtual-machines/windows/build-image-with-packer I did not follow the guide exactly as I already had a…
Ciaránimo
  • 517
  • 1
  • 9
  • 21
2
votes
1 answer

Automate AWS AMI update and Rollout process

I have setup a process for installing and setting up my application stack on a ubuntu base image and then creating an AMI from the machine. All of this is automated using packer. Now once I have the ami-id once packer is done I manually create a new…
2
votes
2 answers

What is the value of {{ .Name }} in a packer template?

From Packer doc I know that {{ .Name }} is a template variable, but for what value is replaced {{ .Name }} when template variable substitution is done? I found several templates that use {{ .Name }} but I failed to found the doc the explain what…
user1785721
2
votes
3 answers

Using Packer, how does one build an Amazon ECR Instance remotely

My problem: I want a docker image saved as an artifact in the Amazon EC2 Registry, built by packer (and ansible) My limitations: The build needs to be triggered by Bitbucket Pipelines. Therefore the build steps need to be executed either in…
dnk8n
  • 675
  • 8
  • 21
2
votes
1 answer

Terraform unable to start docker service

I am using Terraform and Packer for the first time. I am trying to create and AWS AMI for CentOS with Docker built-in. As can be seen from my packer script below, all I am doing is running a number of yum commands as described in docker…
Suhas
  • 7,919
  • 5
  • 34
  • 54
2
votes
2 answers

How do I run a PAR packed file in Windows Vista or Windows 7 running with higher privileges?

Does anyone know how to make a PAR packed Perl application run with higher privileges? I've read that there must be somewhere some kind of manifest file, but how should this file look like and how to combine it with the PAR packed executable? This…
Pawel
  • 171
  • 2
  • 5
2
votes
4 answers

Packer credentials issue error "NoCredentialProviders"?

I'm trying to run a Packer template to build a basic AWS EBS based instance. I keep getting the following error however. ==> amazon-ebs: Error querying AMI: NoCredentialProviders: no valid providers in chain. Deprecated. ==> amazon-ebs: For…
Adron
  • 1,698
  • 3
  • 19
  • 40