HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Packer and compressed ISO images

Submitted by: @import:stackexchange-devops··
0
Viewed 0 times
imagespackerisoandcompressed

Problem

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 key in the JSON description file. But, can Packer handle the cases where the iso file is compressed (e.g. https://example.com/images/image.iso.xz)?

Solution

I tried the dumbest approach, i.e. just to plug the iso.xz file into iso_url and see what happens. Of course, this failed (even after manipulating the iso extension key).

What I ended up doing --- knowing a lot about Bash scripting, and not much about Packer, Go and the like --- is to wrap packer calls in a script that downloads and decompresses the image, then calls Packer on the decompressed image.

I would be curious to know if there are more elegant approaches.

Context

StackExchange DevOps Q#6864, answer score: 1

Revisions (0)

No revisions yet.