forge

Building the GitHub Actions Base Image with Packer

This guide explains how to build the Forge GitHub Actions runner base image using Packer.

Prerequisites

Required Variables

You must provide the following variables to Packer:

Example values:

(Optional) Splunk OTel Collector and Teleport

If you want to include the Splunk OpenTelemetry Collector in your image, set the following environment variables before running Packer:

export SPLUNK_ACCESS_TOKEN=<your_splunk_access_token>
export SPLUNK_REALM=<your_splunk_realm>

If you want to include Teleport or Splunk OTel Collector roles in the build, enable them in your Ansible playbook by uncommenting the roles:

forge/examples/build/ansible/build_gh_base_image.yaml

roles:
  - role: teleport  
  - role: splunk_otel_collector

Build Command

Run the following command from the directory containing your Packer template:

cd forge/examples/build/packer
packer build \
  -var "subnet_id=<your_subnet_id>" \
  -var "vpc_id=<your_vpc_id>" \
  -var "allowed_ssh_cidrs=<your_allowed_ssh_cidrs>" \
  -var "aws_region=<your_aws_region>" \
  .

Example:

cd forge/examples/build/packer
packer build \
  -var "subnet_id=subnet-0123456789abcdef0" \
  -var "vpc_id=vpc-0123456789abcdef0" \
  -var "allowed_ssh_cidrs=10.0.0.0/8" \
  -var "aws_region=us-west-2" \
  .

Notes