DEV Community

ant Kenworthy
ant Kenworthy

Posted on

2 3

Packer: Using an image family from another project

Following on from my previous post: Packer: Building images on Google Cloud You should now be able to build compute images on GCP and you may have used this to build a pre-configured image you can effortlessly deploy again and again without having to wait to install software.

You may now want to use that image, or someone else's image from a different project as a starting point for your web or database server.

If you do you, can add the following line to your packer template in the builders section to specify another project to source your image from:

source_image_project_id
Enter fullscreen mode Exit fullscreen mode

Here's how that may look when used in your packer template:

{
  "builders": [
    {
      "type": "googlecompute",
      "project_id": "my project",
      "zone": "us-central1-a",
      "source_image_family": "base-image-linux",
      "source_image_project_id":, "example-project",
      "ssh_username": "packer",
      "image_name": "packer-{{timestamp}}",
      "image_family": "socks-web"
    }
  ]
}
Enter fullscreen mode Exit fullscreen mode

Here the base-image-linux may contain our companies standard logging setup and common utilities. From this you could then install your web server or database utilities on top of that common image.

Another example may be to use the public images provided by a regulatory body where you need to add some helper scripts before you deploy it to your project.

🎉

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read full post →

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more