Issues with baking ClearLinux AMI (AWS EC2)

Howdy -

I’m using packer to “bake” some Clear Linux AMIs.

I want my AMI build pipeline to work as follows:

clearlinux-armen-base-ami —> This is the “golden” ClearLinux AMI Image. It uses the clear-37000-aws AMI as its source. I install all necessary packages and systems configurations that are the “basline” for all of our servers

clearlinux-armen-web-ami → This is a “derivative” image which uses my base image (clearlinux-armen-base-ami) as its source. It builds upon the installed packages and configurations from my golden image, and adds typical packages and setup to run as a webserver

Problem

I am able to successfully bake my base AMI, save it, and then create an EC2 instance from it. Everything I have installed and configured is there, just like I expect it to be.

When I use my newly-generated Base AMI to try to build my “derived” webserver image, none of the previously installed packages or applications are present (package-utils, iperf, python-extras, etc…) on the packer host.

I have used packer with the -debug flag to access the builder instance to confirm that the packages are missing.

Question

Could this be caused by ucd or some other “boot once at creation” script/service/OneShot that runs when a new instance is being initialized? It’s almost as if something is either deleting my folders (etc, var) or reformatting the volume on first boot.

Any help or advice would be much appreciated. Thank you!

1 Like