How to do it...

In this recipe, we'll create a temporary machine and install Packer. Then, we'll create the necessary configuration files for Packer to create an image running PHP:

  1. To run Packer, let's first create a Debian GNU/Linux 9 instance with Read/Write access to Compute Engine and Full access to Storage:
  1. SSH into the newly-created machine and install Packer (the binaries are available in packer.io):
$ cd ~$ sudo apt-get install unzip$ wget https://releases.hashicorp.com/packer/1.2.2/packer_1.2.2_linux_amd64.zip$ unzip packer_1.2.2_linux_amd64.zip$ lspacker packer_1.2.2_linux_amd64.zip$ ./packerUsage: packer [--version] [--help] ...

Get Building Google Cloud Platform Solutions now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.