Questions tagged [packer]

Packer automates the creation of any type of machine image. It embraces modern configuration management by encouraging you to use automated scripts to install and configure the software within your Packer-made images.

Filter by
Sorted by
Tagged with
0 votes
0 answers
8 views

How to set the Virtual Machine name using Azure Image Builder?

According to this manual one can build an image on Azure using Azure Image Builder. When running the first example, the following error is shown in the customization log: PACKER ERR ==> azure-arm: ...
user avatar
  • 12.5k
1 vote
0 answers
70 views

Packer Ubuntu 21.10 initramfs unpacking failed write error

I'm trying to create a VMI using the official Ubuntu 21.10 iso using Packer and export it to Vagrant box and, if possible, to a simple ISO that I can install manually on another computer. I'm getting ...
user avatar
  • 123
0 votes
1 answer
108 views

How do I force Packer to use Azure client secret in GitHub Actions workflow?

I use the following yml workflow in GitHub: - name: Packer Build run: packer build -force -var 'client_id=${{ secrets.AZURE_CLIENT_ID }}' \ -var 'client_secret=${{ secrets....
user avatar
  • 11
2 votes
0 answers
50 views

How can I chain Packer builds within a single template

I would like to define a single Packer template that consists of 3 builds; each one building upon the previous: source "amazon-ebs" "base" { source_ami_filter { filters { ...
user avatar
0 votes
0 answers
72 views

Testing Raspberry Pi image in a docker container with Packer and qemu

I would like to make a smoke test of a Raspberry Pi image in a docker container. I am building the image using packer.io and the build-arm-image plugin in a gitlab pipeline inside a docker container. ...
user avatar
  • 101
1 vote
1 answer
450 views

Trying to understand sample windows 10 packer template at https://github.com/StefanScherer/packer-windows

I am a beginner to Packer. I am using a template found at https://github.com/StefanScherer/packer-windows for Windows 10, and have been able to create a virtual machine in Hyper-V using the template ...
user avatar
4 votes
0 answers
113 views

Build Windows image for openstack with packer

I am trying to build Windows image for Openstack with packer, but i don't know how to add the autounattend.xml file or floppy files. I build the image with success from qemu but I cannot find the same ...
user avatar
  • 171
2 votes
1 answer
927 views

How do fail a Packer pipeline upon powershell provisioner pester test failure?

I'm building a packer pipeline and having an issue in getting the failure of a powershell provisioner step to fail the packer job itself. This is important as without failing the Packer job, the AMI ...
user avatar
0 votes
2 answers
169 views

Cannot install Ansible

So I am creating a packer template for docker with the image php:7.0-apache. I added a shell provisioner where I try to install ansible so I can provision the image: { "type": "shell", ...
user avatar
  • 105
1 vote
0 answers
295 views

Why does an 'InvalidSnapshot.NotFound' occur in Packer and how to solve it? [closed]

When I'm running sudo packer2 build -debug template.json with this code: { "variables": { "profile": "aws", "region": "eu-west-1" }, "builders": [{ "type": "amazon-chroot", "profile": "{{...
user avatar
  • 11
3 votes
2 answers
740 views

How to run a CMD in a docker container that was created using Packer?

So I am creating a docker image with packer. The template defines the provisioners and builders etc. The builder section looks like this: { "builders": [ { "type": "docker", ...
user avatar
  • 105
4 votes
1 answer
2k views

Bridged network adapter for Packer + VirtualBox?

So, I load an .ova image with packer of a minimal ubuntu linux installation. I realized after everything went through (Provisioners etc) and it successfully exported the output file. However, when ...
user avatar
  • 105
0 votes
0 answers
84 views

How to add Azure VM's admin user to a specific unix group?

I'm creating an Azure VM image using Packer. The VM is just a Debian 10 installation with a couple of packages installed. What I really need to do is to add VM admin user to a specific unix group (...
user avatar
1 vote
0 answers
145 views

How to rite output per builder into separate log files in Packer? [closed]

I have a few packer templates which have several builders - up to 5 per template. This makes it very easy to provision all the resources necessary in a pipeline -- however by default packer writes all ...
user avatar
  • 3,048
4 votes
1 answer
2k views

How to download a VM image from GCP?

I do not see a download button. I would like to download a VM image that was created on GCP using Packer and I would like to run it locally in Virtualbox.
user avatar
  • 12.5k
5 votes
2 answers
3k views

Is it possible to locate the temp keypair generated by Packer?

I`m creating a new image and everything is working. I would like to debug via ssh during the instance creation. A temp keypair is created and attached to the temp instance. My question is, can I get ...
user avatar
2 votes
1 answer
70 views

Understanding Vagrant virtual machine import

I'm building my Windows server 2012 vm with packer and when I'm doing a vagrant up it's failing because the folder name already exists… Here is my json file for packer { "builders": [ { "...
user avatar
0 votes
1 answer
73 views

DevOps Newbie - How to automate windows infrastructure deployment?

DevOps newbie here, so bear with me. I have a project where infrastructure deployment and application deployment is done using powershell and it is tied to VMWare vCenter. For every client deployment,...
user avatar
3 votes
2 answers
176 views

Packer and compressed ISO images

I am not using packer yet, just looking through the documentation. Some VMs it supports can be built from iso images. The examples cover use cases where the ISO is available online through the iso_url ...
user avatar
9 votes
4 answers
3k views

Is there an idiomatic way to create reusable Packer templates?

I'm creating about 10-12 Packer templates which almost all work the same way. Same builder (Amazon EBS), with some small variations in AMI names, and almost the same provisioner (Ansible Remote) - ...
user avatar
  • 1,045
2 votes
1 answer
203 views

Error when using 'ansible-local' provisioner with Docker container

I'm getting an error when running the ansible-local provisioner with a docker builder in Hashicorps Packer. My template (template.json): { "builders": [ { "type": "docker", ...
user avatar
  • 1,153
3 votes
1 answer
334 views

Ansible Remote provisioning not working in Docker container build

I have a Packer template to start with a Docker container and provision it. The shell script provisioners seem to be working, but, while the playbook runs and seems to succeed, unlike the shell ...
user avatar
  • 1,153
2 votes
1 answer
154 views

Parallelising Packer with Ansible

Issue I have an Ansible role which covers Windows, macOS and Ubuntu OS. I also have a Packer template file for each OS (due to small nuances and changes in the template file to handle provisioning) ...
user avatar
  • 933
6 votes
6 answers
919 views

In the HashiCorp stack, where's the appropriate place to add users?

I'm in the process of building some custom Linux images using HashiCorp's Packer, which will later be deployed to Azure using HashiCorp's Terraform. The VMs created from these images will need to have ...
user avatar
  • 161
4 votes
1 answer
245 views

difference between packer and matchbox

I have this setup to standup a baremetal machine: Terraform-> Matchbox \-> Chef-> Docker My colleague has a setup to standup VMs in AWS: Terraform-> Packer-> Chef-> ...
user avatar
  • 466
9 votes
3 answers
426 views

How should we automatically rebuild immutable infrastructure when new packages are available?

We're going to be using Terraform to automate our infrastructure deployment and Packer to create the machine images deployed by Terraform. By following immutable infrastructure design principles, we ...
user avatar
2 votes
1 answer
450 views

Deploying to VSphere with Packer and/or Terraform?

Scenario: Creating multiple VMs and deploying them to VSphere. Current development uses Packer and Ansible to provision a Fusion VM, with the aim of using Terraform to deploy to VSphere. Issue: I'...
user avatar
  • 933
7 votes
1 answer
4k views

What are reasons for using HashiCorp's packer to build docker images instead of using docker build?

I have read https://www.packer.io/docs/builders/docker.html, but I do not see the advantage of using Packer over docker build or docker-compose up --build for building docker images
user avatar
  • 12.5k
5 votes
1 answer
73 views

Storing Meta Data for Apps/tools

Have created a number of images via packer and soon coming to the conclusion that binaries/images soon rack up in qty and need to find away to store config data. We are going to use ansible to hold ...
user avatar
4 votes
1 answer
971 views

Force script to fail if "npm install" has network issues

With the current Github outage, I noticed a problem with my packer setup. In a nutshell, I have a packer setup where I call a shell script that looks like this: #!/bin/bash set -e ... npm install ... ...
user avatar
6 votes
3 answers
630 views

Baking Immutable Images

I am working on a project and we are trying to bake immutable images on containers as IaC. These images can have J2EE, .NET or Python apps on it. All OS patches should be applied to this image ...
user avatar
3 votes
1 answer
1k views

How does using packer and terraform in a CD pipeline compare to docker images built from git?

At work we have a Go CD pipeline for producing docker images, and scheduling docker containers with rancher. This works quite well. You can commit a change to the Docker image in Git, the pipeline ...
user avatar
  • 1,073
36 votes
5 answers
9k views

How to avoid interactive dialogs when running "apt-get upgrade -y" in Ubuntu 16.04 when packaging with Packer?

I'm using Packer to create an AWS AMI based on an Ubuntu 16.04 image. In the beginning, I'm doing an upgrade: sudo apt-get update sudo apt-get upgrade -y Here is the relevant part of my provisioners ...
user avatar
8 votes
3 answers
2k views

How to remotely update AMI id in Jenkins EC2 plugin?

I have been looking for a way to update AMI id in Jenkins EC2 plugin configuration after a packer build is run. After some digging, I found a promising way to do it IF the packer run is done by ...
user avatar