Create ISO\Image with Linux by using Packer solution

Hi Guys,

I’ve got quick question. What I can see we don’t have any post-provisioner that allows us create ISO. My workflow is: Packer gets vanilla CentOS, doing provisioning and as output I need installation image with all changes. I guess bootable ISO file would be perfect but other options are also possible. I just need to later install this customized ISO on other devices in easy way.

Do you have any idea how to capture image after provisioning with Packer to ISO or other image format that I can use for further local installations?

Same goal here. Any sugestion?

Packer doesn’t support building for bare metal, which I’m inferring is what you’re asking for here. (If your “devices” are instead VMs or Containers, then you should be able to just use the wealth of existing builders.)

As the current list of official builder plugins does not include anything that provides this behavior, my answer is that what you ask requires extending Packer with a custom builder.

This thread was the first hit when I googled “create installable iso from packer”, but I know there has been much past discussion about adding this feature to packer, notably this one, which is now closed.

That last link includes this comment from @vtolstov indicating how he uses mksquashfs to create a normal file containing the entire root filesystem of a packer-built-vm, then copies its kernel and initrd from its boot partition, then makes all 3 of these available as downloadable packer artifacts. There are several tools available to construct a bootable iso from these files.

That issue referred to the newer-but-still-quite-old issue specifically about building an iso from packer (the other was more about pxe boot). This issue is unfortunately rather empty but does refer to this project, by @viralpoetry which appears to just do an alpine linux packer build to virtualbox .ova, and just provides instructions in the README for converting the .vdmk to a raw disk file, then write it to a sub drive. So, this is another approach to achieving what we want.

To Whom It May Concern, I just created a new Packer Feature Request for this:

1 Like