Technical requirements
For our Hello World base image, let’s choose a simple Linux base image that we will customize with a Message of the Day (MOTD) that says Hello World from Packer. Then, we will add a few bells and whistles in stages. We’ll focus on HCL2 since JSON is considered legacy by the Packer developers. You will need to have Packer version 1.5 or newer installed to try this, and you’ll need to either install VirtualBox or select a different hypervisor or builder to use in its place. This build assumes you have an Intel x86_64-compatible PC with VirtualBox installed and sufficient CPU, and at least 8 GB of RAM to run the VM required for the build. Other platforms and architectures such as ARM should work, as long as the template image is adjusted. It doesn’t matter whether your operating system is macOS, Windows, or Linux, as long as VirtualBox and Packer are available for your platform.