Skip to content

Latest commit

 

History

History
34 lines (26 loc) · 869 Bytes

README.md

File metadata and controls

34 lines (26 loc) · 869 Bytes

CentOS 7

Installing prerequisites

  1. Install packer
  2. Install Google Cloud SDK

Authenticate with Google Cloud

Packer uses the Application Default Credentials to connect with Google Cloud.

Run this command to create the credentials and login with the correct account.

gcloud auth application-default login

Build and publish Compute Engine image

Replace [your-project] in the next snippet with the ID of the project we created for you (or your own project).

export PROJECT=[your-project]

Building the base image

To build the base image, run this snippet.

packer build -var project_id=$PROJECT base.pkr.hcl

Verify

To check if the image is ready, run:

gcloud compute images list --project $PROJECT --no-standard-images

Done!