#320·cap

Build and publish Docker image through CI with provenance

Author: emouawadCreated Sep 22, 2026Updated Sep 22, 2026

I really like Cap and am considering using the standalone Docker image in a self-hosted deployment. Before doing that, I noticed that the published tiago2/cap image does not appear to be built and published through GitHub Actions.

Currently, standalone/package.json contains a docker:publish script that manually runs docker buildx build ... --push with the tiago2/cap tags. The repository's GitHub Actions workflows currently cover testing and other automation, but I could not find a workflow that builds and publishes the Docker image. The production standalone/docker-compose.yml then pulls tiago2/cap:latest.

This works, but for a security-sensitive project such as a CAPTCHA/anti-abuse service, I think the container release process would benefit significantly from being automated and reproducible.

Why I think this matters

The main issue is not that a manual build is inherently unsafe, but that there is no strong, independently verifiable link between:

Git commit / release tag
        ↓
source that was reviewed
        ↓
Docker build
        ↓
published image

With the current workflow, the final Docker image depends on a manual build/push performed outside the repository's auditable CI history.

That creates several risks:

  • A maintainer workstation or Docker credentials being compromised could result in a malicious image being pushed without a corresponding source-code change.
  • A maintainer could accidentally build from a different commit, working tree state, or local environment than the GitHub release/tag users associate with the version.
  • Consumers cannot easily verify that a published image was actually built from the corresponding repository commit.
  • There is no GitHub Actions build record directly associated with the published container.
  • There is currently no obvious provenance/attestation or SBOM associated with the Docker image, making supply-chain verification and auditing harder.
  • Using a mutable latest tag further weakens reproducibility unless consumers pin the image by digest.

These are especially relevant for Cap because the standalone container is intended to sit directly on the boundary of applications and handle untrusted Internet traffic.

What I would suggest

I think the repository would benefit from a dedicated GitHub Actions workflow that builds and publishes the standalone image automatically from releases/tags.

Ideally the workflow would:

  1. Trigger from a GitHub release or version tag.

  2. Check out exactly that tag/commit.

  3. Run the existing test suite before publishing.

  4. Build the existing standalone/Dockerfile using BuildKit/buildx.

  5. Publish the same linux/amd64 and linux/arm64 images currently published by tiago2/cap.

  6. Generate image provenance/attestations so consumers can verify which repository, commit, and workflow produced the image.

  7. Generate/publish an SBOM.

  8. Publish immutable version tags such as:

    • 3.1.11
    • 3.1
    • 3
    • latest
  9. Ideally document the release-to-image relationship and recommend digest pinning for production deployments.

GitHub provides native artifact attestations specifically for establishing where and how an artifact was built, including the repository, workflow, commit SHA, and triggering event. Attestations can also include an SBOM.

Docker's current GitHub Actions documentation also supports generating provenance and SBOM attestations as part of docker/build-push-action.

GitHub's own Docker publishing documentation provides a release-triggered GitHub Actions pattern for publishing images, and recommends pinning third-party Actions to commit SHAs rather than mutable tags.

Example of the desired release flow

Git tag / GitHub release
        │
        ▼
GitHub Actions
        │
        ├── tests
        ├── Docker buildx
        ├── SBOM
        ├── provenance attestation
        │
        ▼
Docker Hub
        │
        ├── tiago2/cap:3.1.11
        ├── tiago2/cap:3.1
        ├── tiago2/cap:3
        └── tiago2/cap:latest

This would preserve the current Docker Hub distribution model while making the build reproducible, auditable, and much easier for downstream users to trust.

I am not suggesting that the current tiago2/cap image is malicious or compromised. My concern is that the current release process does not give consumers enough information to independently establish that the published image corresponds to the source release they intended to run.

Since Cap is an Internet-facing security/anti-abuse component, I think having the container built by CI with provenance and an SBOM would be a valuable part of the project's security story.

Thanks for considering it, and thanks for maintaining Cap.