This guide explains how to build the Forge GitHub Actions runner base image using Packer.
You must provide the following variables to Packer:
subnet_id
: The subnet where the instance will be launchedvpc_id
: The VPC where the instance will be launchedallowed_ssh_cidrs
: CIDR blocks allowed to SSH into the instance (for debugging)aws_region
: The AWS region to build the image inExample values:
subnet_id=subnet-0123456789abcdef0
vpc_id=vpc-0123456789abcdef0
allowed_ssh_cidrs=10.0.0.0/8
aws_region=us-west-2
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
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" \
.