Metadata-Version: 2.1
Name: containerhive
Version: 1.21.0
Summary: Swarm it. Build it. Run it. — container image builds made easy.
Description-Content-Type: text/markdown
License: AGPLv3
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Environment :: Console
Classifier: Environment :: MacOS X
Classifier: Operating System :: POSIX
Classifier: Operating System :: Unix
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Project-URL: Homepage, https://github.com/ContainerHive/ContainerHive
Project-URL: Source Code, https://github.com/ContainerHive/ContainerHive.git
Project-URL: Issues, https://github.com/ContainerHive/ContainerHive/issues
Requires-Python: >=3.12

ContainerHive
===
[![LICENSE](https://img.shields.io/github/license/ContainerHive/ContainerHive)](https://github.com/ContainerHive/ContainerHive/blob/main/LICENSE)
[![CircleCI](https://circleci.com/gh/ContainerHive/ContainerHive.svg?style=shield)](https://app.circleci.com/pipelines/github/ContainerHive/ContainerHive)
[![codecov](https://codecov.io/gh/ContainerHive/ContainerHive/graph/badge.svg?token=5MGUHVhimo)](https://codecov.io/gh/ContainerHive/ContainerHive)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=ContainerHive_ContainerHive&metric=alert_status)](https://sonarcloud.io/dashboard?id=ContainerHive_ContainerHive)
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=ContainerHive_ContainerHive&metric=security_rating)](https://sonarcloud.io/dashboard?id=ContainerHive_ContainerHive)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=ContainerHive_ContainerHive&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=ContainerHive_ContainerHive)
[![GitHub Release](https://img.shields.io/github/v/tag/ContainerHive/ContainerHive?label=version)](https://github.com/ContainerHive/ContainerHive/releases)
[![Renovate](https://img.shields.io/badge/renovate-enabled-green?logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciI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z4=)](https://renovatebot.com)
[![pre-commit](https://img.shields.io/badge/%E2%9A%93%20%20pre--commit-enabled-success)](https://pre-commit.com/)

<p align="center">
	<img width="512" src="https://raw.githubusercontent.com/ContainerHive/ContainerHive/refs/heads/main/.github/images/logo.png">
    <br />
    Swarm it. Build it. Run it. — Managing container base and library images has never been easier.
</p>

## Motivation

Managing container base and library images at scale is painful: scattered Dockerfiles, hand-rolled CI, inconsistent
tagging and no dependency tracking. ContainerHive is a single static Go binary that resolves the dependency graph
between your images, builds them with BuildKit, tests them and generates the CI pipeline. It is the production-grade
successor of [poc-container-image-manager](https://github.com/timo-reymann/poc-container-image-manager).

## Why not just do it manually?

Take a typical set of CI images, each building on another:

```
ubuntu-base      curl, wget, zip, internal CI tools
├── node            + Node.js, Yarn
│   └── node-browsers   + Chrome, Firefox, Playwright
└── python          + uv, Poetry, pip
    └── pre-commit      + pre-commit, global dev tools, toolchains hooks rely on
```

Doing this by hand means writing the CI pipeline yourself, wiring `needs:` so each child waits for its parent,
handling tagging and pushing so children find the right parent, writing tests and hooking them into the pipeline,
and updating all of it whenever an image is added or re-parented.

With ContainerHive you drop flat image directories into your project, and each Dockerfile references its parent with
`FROM __hive__/<image>:<tag>`. ContainerHive resolves the dependency graph, generates the CI pipeline with the right build
order and parallelism, detects which images have a `test.yml` and adds the test steps for them, and passes parent
images to children without a registry round trip.

See [Why use ContainerHive?](https://container-hive.timo-reymann.de/why-containerhive/) for the full walkthrough with
diagrams.

## Features

- **Next-gen builds**: Powered by BuildKit, the modern container image builder behind Docker.
- **Multi-platform ready**: Build and push images for any architecture in a single workflow.
- **YAML-driven management**: Define and maintain image sets and variants declaratively.
- **Reproducible layers**: Guarantee consistent, bit-for-bit identical builds every time (given the same inputs).
- **Testing built in**: Validate images as part of the build process, no extra tooling needed.
- **Smart caching**: Optimized caching via S3 or registry backends, no manual tuning required.
- **SBOM generation**: Generate CycloneDX SBOMs for all built images using Syft.
- **CI pipeline generation**: Generate GitLab CI and GitHub Actions pipelines from your project definition.
- **Bring your own BuildKit**: Connect to any BuildKit instance — local daemon, shared cluster service, or sidecar in a
  hardened Kubernetes environment.
- **Enterprise-ready**: Built for scale, compliance, and integration with enterprise workflows.
- **Nix and Chisel backends (experimental)**: Define the filesystem with a Nix flake, or cut minimal Ubuntu package
  slices with chisel — no Dockerfile needed.

## Supported platforms

The following platforms have prebuilt binaries:

- Linux
    - 64-bit
    - ARM 64-bit
- Darwin
    - 64-bit (Intel)
    - ARM 64-bit (Apple Silicon)
- Docker (x86 & ARM)

## Requirements

- [BuildKit](https://github.com/moby/buildkit) daemon
- S3-compatible storage for caching (optional)

## Installation

Use [0install](https://0install.net) for automatic updates or install the binaries directly:

```sh
0install add ch https://containerhive.github.io/0install/containerhive.xml
```

See the [installation guide](https://container-hive.timo-reymann.de/installation.html), then follow
[Get started](https://container-hive.timo-reymann.de/getting-started/).

## Documentation

Documentation is available at [container-hive.timo-reymann.de](https://container-hive.timo-reymann.de/), hosted on
GitHub Pages.

## Contributing

I love your input! I want to make contributing to this project as easy and transparent as possible, whether it's:

- Reporting a bug
- Discussing the current state of the configuration
- Submitting a fix
- Proposing new features
- Becoming a maintainer

To get started please read the [Contribution Guidelines](./CONTRIBUTING.md).

## Development

### Requirements

- [GNU make](https://www.gnu.org/software/make/)
- [Docker](https://docs.docker.com/get-docker/)
- [pre-commit](https://pre-commit.com/)
- [Go](https://go.dev/doc/install)

### Test

```shell
make test-coverage-report
```

### Build

```shell
make build
```

### AI Usage

This project uses AI tooling to assist with development. All AI-generated or AI-assisted changes are **human-reviewed**
and applied responsibly — this is not AI slop. Contributors are expected to uphold the same standard: AI tools are
welcome, but every change must be understood, reviewed, and owned by the person submitting it.

### Credits

Without these libraries this project would not be possible:

- [syft](https://github.com/anchore/syft) by Anchore
- [buildkit](https://github.com/moby/buildkit) by the Moby Project
- [container-structure-test](https://github.com/GoogleContainerTools/container-structure-test) by Google
- [hadolint](https://github.com/hadolint/hadolint)
