I am still new to Packer but last year I was able to take some examples using amazon-ebssurrogate to build out a centos7 AMI and make it work for RockyLinux8. Now I am trying to take my RockyLinux8 code and build a RockyLinux9 AMI. But this time I am also trying to see if there are easier ways.
Using amazon-ebssurrogate I am already doing a lot of chroot work building out the system. So it occurred to me that if I use the amazon-chroot builder it might be easier. That said the first question I have is when you run the amazon-chroot does that put you on the new Blank EBS volume in a chrooted environment and hides the EBS you booted from? So at that point when I run a provisioner like a shell script its assumed to be run through a chroot? So I could run dnf install -y python3
as an example and the provisioner would install python3 on the new BLANK EBS volume (assuming its been formatted and what not). I should not need to prepend chroot infront of my commands in the provisioner like so: chroot "${ROOTFS}" dnf install -y python3
.
Thanks