Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
hashicorp avatar

Push To Registry

  • 2k installs
  • 781 repo stars
  • Updated August 4, 2026
  • hashicorp/agent-skills

push-to-registry is an agent skill for Push Packer build metadata to HCP Packer registry for tracking and managing image lifecycle. Use when integrating Packer

About

The push-to-registry skill Push Packer build metadata to HCP Packer registry for tracking and managing image lifecycle. Use when integrating Packer builds with HCP Packer for version control and governance. It covers navigate to HCP → Access Control IAM. Key workflows include create Service Principal. Developers invoke push-to-registry when the task matches the triggers and reference files in SKILL.md for grounded, stepwise execution. Reference files and progressive disclosure keep context focused while preserving concrete commands, configuration fields, and validation checks copied from the upstream documentation. Reference files and progressive disclosure keep context focused while preserving concrete commands, configuration fields, and validation checks copied from the upstream documentation. Reference files and progressive disclosure keep context focused while preserving concrete commands, configuration fields, and validation checks copied from the upstream documentation. Reference files and progressive disclosure keep context focused while preserving concrete commands, configuration fields, and validation checks copied from the upstream documentation.

  • Navigate to HCP → Access Control IAM
  • Create Service Principal
  • Grant "Contributor" role on project
  • Generate client secret
  • Save client ID and secret

Push To Registry by the numbers

  • 2,007 all-time installs (skills.sh)
  • +99 installs in the week ending Aug 5, 2026 (Skillselion tracking)
  • Ranked #389 of 2,153 Testing & QA skills by installs in the Skillselion catalog
  • Security screen: MEDIUM risk (skills.sh audit)
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
At a glance

push-to-registry capabilities & compatibility

Capabilities
navigate to hcp → access control iam · create service principal · grant "contributor" role on project · generate client secret · save client id and secret
Use cases
documentation
From the docs

What push-to-registry says it does

description: Push Packer build metadata to HCP Packer registry for tracking and managing image lifecycle. Use when integrating Packer builds with HCP Packer for version control and governance.
SKILL.md
Configure Packer templates to push build metadata to HCP Packer registry.
SKILL.md
npx skills add https://github.com/hashicorp/agent-skills --skill push-to-registry

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs2k
repo stars781
Security audit3 / 3 scanners passed
Last updatedAugust 4, 2026
Repositoryhashicorp/agent-skills

What problem does push-to-registry solve for developers using the documented workflows?

Push Packer build metadata to HCP Packer registry for tracking and managing image lifecycle. Use when integrating Packer builds with HCP Packer for version control and governance.

Who is it for?

Developers working with push-to-registry patterns described in the skill documentation.

Skip if: Skip when docs are empty or the task is outside the skill documented scope.

When should I use this skill?

Use when Push Packer build metadata to HCP Packer registry for tracking and managing image lifecycle. Use when integrating Packer builds with HCP Packer for version control and governance.

What you get

Actionable push-to-registry guidance grounded in SKILL.md workflows and reference files.

  • Packer HCL registry configuration
  • HCP Packer metadata records

By the numbers

  • Requires Packer >= 1.7.7 per documented template configuration
  • Metadata-only registry push adds minimal overhead under 1 minute per build

Files

SKILL.mdMarkdownGitHub ↗

Push to HCP Packer Registry

Configure Packer templates to push build metadata to HCP Packer registry.

Reference: HCP Packer Registry

Note: HCP Packer is free for basic use. Builds push metadata only (not actual images), adding minimal overhead (<1 minute).

Basic Registry Configuration

packer {
  required_version = ">= 1.7.7"
}

variable "image_name" {
  type    = string
  default = "web-server"
}

locals {
  timestamp = regex_replace(timestamp(), "[- TZ:]", "")
}

source "amazon-ebs" "ubuntu" {
  region        = "us-west-2"
  instance_type = "t3.micro"

  source_ami_filter {
    filters = {
      name = "ubuntu/images/*ubuntu-jammy-22.04-amd64-server-*"
    }
    most_recent = true
    owners      = ["099720109477"]
  }

  ssh_username = "ubuntu"
  ami_name     = "${var.image_name}-${local.timestamp}"
}

build {
  sources = ["source.amazon-ebs.ubuntu"]

  hcp_packer_registry {
    bucket_name = var.image_name
    description = "Ubuntu 22.04 base image for web servers"

    bucket_labels = {
      "os"   = "ubuntu"
      "team" = "platform"
    }

    build_labels = {
      "build-time" = local.timestamp
    }
  }

  provisioner "shell" {
    inline = [
      "sudo apt-get update",
      "sudo apt-get upgrade -y",
    ]
  }
}

Authentication

Set environment variables before building:

export HCP_CLIENT_ID="your-service-principal-client-id"
export HCP_CLIENT_SECRET="your-service-principal-secret"
export HCP_ORGANIZATION_ID="your-org-id"
export HCP_PROJECT_ID="your-project-id"

packer build .

Create HCP Service Principal

1. Navigate to HCP → Access Control (IAM) 2. Create Service Principal 3. Grant "Contributor" role on project 4. Generate client secret 5. Save client ID and secret

Registry Configuration Options

bucket_name (required)

The image identifier. Must stay consistent across builds!

bucket_name = "web-server"  # Keep this constant

bucket_labels (optional)

Metadata at bucket level. Updates with each build.

bucket_labels = {
  "os"        = "ubuntu"
  "team"      = "platform"
  "component" = "web"
}

build_labels (optional)

Metadata for each iteration. Immutable after build completes.

build_labels = {
  "build-time" = local.timestamp
  "git-commit" = var.git_commit
}

CI/CD Integration

GitHub Actions

name: Build and Push to HCP Packer

on:
  push:
    branches: [main]

env:
  HCP_CLIENT_ID: ${{ secrets.HCP_CLIENT_ID }}
  HCP_CLIENT_SECRET: ${{ secrets.HCP_CLIENT_SECRET }}
  HCP_ORGANIZATION_ID: ${{ secrets.HCP_ORGANIZATION_ID }}
  HCP_PROJECT_ID: ${{ secrets.HCP_PROJECT_ID }}

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: hashicorp/setup-packer@main

      - name: Build and push
        run: |
          packer init .
          packer build \
            -var "git_commit=${{ github.sha }}" \
            .

Querying in Terraform

data "hcp_packer_artifact" "ubuntu" {
  bucket_name  = "web-server"
  channel_name = "production"
  platform     = "aws"
  region       = "us-west-2"
}

resource "aws_instance" "web" {
  ami           = data.hcp_packer_artifact.ubuntu.external_identifier
  instance_type = "t3.micro"

  tags = {
    PackerBucket = data.hcp_packer_artifact.ubuntu.bucket_name
  }
}

Common Issues

Authentication Failed

  • Verify HCP_CLIENT_ID and HCP_CLIENT_SECRET
  • Ensure service principal has Contributor role
  • Check organization and project IDs

Bucket Name Mismatch

  • Keep bucket_name consistent across builds
  • Don't include timestamps in bucket_name
  • Creates new bucket if name changes

Build Fails

  • Packer fails immediately if can't push metadata
  • Prevents drift between artifacts and registry
  • Check network connectivity to HCP API

Best Practices

  • Consistent bucket names - Never change for same image type
  • Meaningful labels - Use for versions, teams, compliance
  • CI/CD automation - Automate builds and registry pushes
  • Immutable build labels - Put changing data (git SHA, date) in build_labels

References

Related skills

Forks & variants (1)

Push To Registry has 1 known copy in the catalog totaling 25 installs. They canonicalize to this original listing.

How it compares

Choose this over generic container registry skills when governance requires HCP Packer metadata lineage for Packer-built images across cloud artifact stores.

FAQ

Who is push-to-registry for?

Developers and software engineers working with push-to-registry patterns described in the skill documentation.

When should I use push-to-registry?

When Push Packer build metadata to HCP Packer registry for tracking and managing image lifecycle. Use when integrating Packer builds with HCP Packer for version control and governance.

Is push-to-registry safe to install?

Review the Security Audits panel on this page before installing in production.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.