Minimal Alpine container demonstrating ApstraHub container publishing workflow.
This repository serves as a reference example for publishing containers to ApstraHub, demonstrating:
- GitHub Actions workflow for container build and push
- Cosign keyless signing via Sigstore/OIDC
- OCI label conventions for metadata extraction
- GitHub release with
container-url.txtasset - GHCR registry configuration
| Field | Value |
|---|---|
| Base Image | alpine:3.22 |
| Version | v1.0.0 |
| Registry | ghcr.io/juniper/apstrahub-container-test-alpine |
| Visibility | Public (required for apstrahub-publisher) |
| License | MIT |
The container includes standard OCI labels for metadata extraction:
org.opencontainers.image.title: ApstraHub Container Example - Alpineorg.opencontainers.image.description: Minimal Alpine container demonstrating ApstraHub container publishingorg.opencontainers.image.version: 1.0.0org.opencontainers.image.authors: ApstraHub Teamorg.opencontainers.image.source: https://github.com/Juniper/apstrahub-container-test-alpineorg.opencontainers.image.licenses: MIT
The container includes the required org.apstrahub.tags label for Apstra Hub publishing:
{"purpose": "Feature"}| Key | Required | Valid Values | Description |
|---|---|---|---|
purpose |
Yes | Feature, Analytics |
Categorizes the container's purpose |
type |
No | Container |
Optional; if set, must be Container |
See hub_container.md for the complete specification.
When a tag matching v* is pushed (e.g., v1.0.0):
- Container is built from
Dockerfile - Container is pushed to GitHub Container Registry (GHCR)
- Container is signed with Cosign using key-pair (private key from GitHub secret)
- GitHub release is created with
container-url.txtasset
Important: The GHCR package must have public visibility for the apstrahub-publisher service to pull the container without authentication.
After the first push, set visibility in:
GitHub → Packages → apstrahub-container-test-alpine → Settings → Change visibility → Public
Register this container in ApstraHub with key-pair Cosign verification:
{
"github_org": "Juniper",
"github_repo": "apstrahub-container-test-alpine",
"pack_type": "container",
"signing_method": "cosign",
"cosign_public_key_path": "cosign.pub"
}docker build -t apstrahub-container-example .
docker run apstrahub-container-example# Verify Cosign signature with public key
cosign verify \
--key cosign.pub \
ghcr.io/juniper/apstrahub-container-test-alpine:v1.0.0The private key must be stored as a GitHub secret for CI signing:
- Go to repository Settings → Secrets and variables → Actions
- Click New repository secret
- Name:
COSIGN_PRIVATE_KEY - Value: Paste the contents of
cosign.key(the private key file) - Click Add secret
cosign.key secure and never commit it to the repository!
MIT License - see LICENSE for details.