# Docker Hub Tag/Digest Delta Monitor (`collinjreynolds/docker-hub-tag-digest-delta-monitor`) Actor

Monitors Docker Hub image repositories for new tags and digest changes on mutable tags via official Hub JSON APIs. First run baselines without charging. PPE event: digest-change.

- **URL**: https://apify.com/collinjreynolds/docker-hub-tag-digest-delta-monitor.md
- **Developed by:** [Collin Reynolds](https://apify.com/collinjreynolds) (community)
- **Categories:** Developer tools, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 tag or digest changes

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Docker Hub Tag/Digest Delta Monitor

Watch Docker Hub image repositories for **new tags** and **digest pointer changes** on mutable tags (`latest`, `stable`, …) via the official Hub JSON API. Only **deltas** since the last run are written to the dataset — ideal for scheduled base-image and dependency monitoring.

**Pricing (pay per event):** charged mainly for each **new tag or digest change** detected (`digest-change` @ **$0.001**). First run baselines quietly (0 dataset items / 0 delta charges) so you are not billed for history. Same baseline-safe PPE shape as the live [GitHub Releases Delta Monitor](https://apify.com/collinjreynolds/github-releases-delta-monitor).

### Why use this

- **API-only** — official Docker Hub Hub HTTP JSON (`/v2/.../tags`); no HTML scraping of hub.docker.com UI
- **Digest-aware** — fingerprints are `tag + digest`, so mutable tags fire when the pointer moves
- **Delta-only** — subsequent runs emit new tags and digest changes only
- **First-run safe** — empty state seeds `LAST_SEEN` with zero PPE delta charges
- **Optional tag allowlist** — watch just `latest` / `stable` without inventorying every historical tag
- **Optional Hub token** — higher rate limits; public repos work without one
- **Schedule-friendly** — pair with an Apify schedule for continuous monitoring

### Input

| Field | Required | Description |
|-------|----------|-------------|
| `images` | yes | List of `namespace/repository` (or official short names like `nginx` → `library/nginx`) |
| `tags` | no | Tag allowlist (e.g. `["latest","stable"]`); empty = all tags within page budget |
| `hubToken` | no | Docker Hub PAT (secret) as `Authorization: Bearer` |
| `sinceTag` | no | On first run for an image, treat this tag and older (newest-first) as already seen |
| `maxPages` | no | Max Hub tags pages per image (default 2) |
| `pageSize` | no | Hub `page_size` 1–100 (default 100) |
| `resetState` | no | Clear `LAST_SEEN` and re-baseline (0 emits that run) |

#### Example

```json
{
  "images": ["library/nginx", "library/python"],
  "tags": ["latest", "stable"],
  "maxPages": 2,
  "pageSize": 100,
  "resetState": false
}
```

### Output

Each dataset item is a newly detected tag or digest change, for example:

- `image`, `tag`, `digest`, `previous_digest`, `change_kind` (`new-tag` | `digest-change`), `last_updated`, `full_ref`, `hub_url`

### First-run behavior

| Situation | Dataset items | `digest-change` charges |
|-----------|---------------|-------------------------|
| Empty state, no `sinceTag` | **0** | **0** (baseline only) |
| Empty state + `sinceTag` | Only newer-than that tag (newest-first) | 1 per item |
| Later runs | New tags + digest pointer moves | 1 per item |

### Mutable tags — read carefully

Tags like `latest`, `stable`, or `3` are **mutable**: the same name can point at a new content digest after a rebuild or roll-forward. This Actor:

- Stores fingerprints as `tag:{name}:digest:{sha256:…}`
- Emits a **`digest-change`** when the digest for a known tag name changes
- Emits a **`new-tag`** when a tag name appears for the first time in the watched set

Pin immutable digests in production deploys when you need bit-for-bit reproducibility; use this Actor to *detect* when mutable pointers move.

### Tips

1. Run once to baseline, then attach a **schedule** (e.g. hourly/daily).
2. Prefer a **tag allowlist** for busy official images (thousands of tags).
3. Add a `hubToken` if you monitor many repos (anonymous Hub rate limits are lower).
4. Set a user **max total charge** on the run so costs stay predictable.

### ToS / scope

Uses Docker Hub’s official Hub HTTP JSON API only (tag list endpoints under `https://hub.docker.com/v2/...`). Digests are taken from API fields — never invented. See [AGREEMENT.md](./AGREEMENT.md). Respect Hub rate limits and terms. Private registries are out of scope for v0.

# Actor input Schema

## `images` (type: `array`):

List of Docker Hub repositories as namespace/repository (e.g. library/nginx, bitnami/redis). Official short names like nginx map to library/nginx. Public repos work without a token.

## `tags` (type: `array`):

If set, only these tag names are watched (recommended for mutable tags like latest/stable). If empty, all tags returned within maxPages are fingerprinted.

## `hubToken` (type: `string`):

Optional Hub Personal Access Token for higher rate limits. Sent as Authorization: Bearer. Never hardcoded; supply via Actor input/secret. Public repos work without a token.

## `sinceTag` (type: `string`):

If set and no LAST\_SEEN snapshot exists for an image, assume tags are newest-first and treat this tag (and older) as already seen so only newer tags are emitted on that first run.

## `maxPages` (type: `integer`):

Light pagination cap for Hub tags list (page\_size items/page, max 100).

## `pageSize` (type: `integer`):

Hub tags page\_size (1–100).

## `resetState` (type: `boolean`):

If true, ignore and clear the stored LAST\_SEEN fingerprint map before this run.

## Actor input object example

```json
{
  "images": [
    "library/nginx",
    "library/python"
  ],
  "maxPages": 2,
  "pageSize": 100,
  "resetState": false
}
```

# Actor output Schema

## `overview` (type: `string`):

Dataset items for newly detected tags or digest changes (image, tag, digest, change\_kind, etc.). First run baselines with 0 items.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "images": [
        "library/nginx",
        "library/python"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("collinjreynolds/docker-hub-tag-digest-delta-monitor").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "images": [
        "library/nginx",
        "library/python",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("collinjreynolds/docker-hub-tag-digest-delta-monitor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "images": [
    "library/nginx",
    "library/python"
  ]
}' |
apify call collinjreynolds/docker-hub-tag-digest-delta-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,collinjreynolds/docker-hub-tag-digest-delta-monitor"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/wCvwmgyiuxY9y9K0h/builds/vGgl1HkQgkScSuVLF/openapi.json
