> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cloudthinker.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Docker Hub

> Connect Docker Hub so agents can inventory repositories, compare pulls and push age, inspect tags, and update descriptions

Connect Docker Hub so CloudThinker agents can list the repositories in your namespaces, compare visibility, pulls, and last-push age, and inspect each repository's tags. The connection uses your Docker Hub username and a personal access token (PAT), and it ships read-only.

## Prerequisites

* A Docker account with access to the personal and organization repositories you want agents to inspect.
* Your Docker Hub username: the account name, not your email address or an organization name.
* For organization repositories: a Docker account that's a member of the organization. A dedicated account for CloudThinker keeps the token separate from a person's login.

## Setup

**1. Create a personal access token**

In Docker Home, select your avatar, then **Account settings → Personal access tokens** ([app.docker.com/settings/personal-access-tokens](https://app.docker.com/settings/personal-access-tokens)), and click **Generate new token**. Set:

* **Access token description**: `cloudthinker`
* **Expiration date**: a lifetime that matches your rotation policy
* **Access permissions**: **Repo Read-only**. Pick **Repo Read, Write, Delete** only if you want agents to update repository descriptions (see [Write access](#write-access)).

Don't keep the default, **Repo Public Read-only**. It can't read private repositories, so agents miss every private repository in your namespaces.

Click **Generate** and copy the token. Docker shows it only once.

**2. Add the connection**

Open **More → Workspace settings → Connections**, stay on the **Builtin Connections** tab, and select **Docker Hub**. Fill in:

* **Docker Hub username**: the account that created the PAT, such as `myuser`.
* **Personal access token**: the PAT. Not your Docker Hub password.

Click **Connect**. CloudThinker signs in and reads your personal namespace.

**Success state:** the connection shows **Connected**, with a message such as `Connected to Docker Hub namespace myuser (12 repositories)`.

## Connection details

| Field | Description | Example |
| - | - | - |
| **Docker Hub username** | Account that owns the PAT. Letters, digits, `.`, `-`, and `_` only | `myuser` |
| **Personal access token** | PAT from Docker account settings | |

There's no namespace field. Your personal namespace is your username, and agents discover organization namespaces from the token.

## Required permissions

| PAT permission | What it enables |
| - | - |
| **Repo Public Read-only** (Docker's default) | Public repositories only. Private repositories don't show up. |
| **Repo Read-only** | Every read: namespaces, repositories, visibility, pulls, stars, push age, and tags, including private repositories |
| **Repo Read, Write, Delete** | Every read, plus updating a repository's short description and overview |

Docker Hub refuses description updates from a **Repo Read & Write** PAT, so that level gives agents nothing extra.

> [!TIP]
>
> Start with a **Repo Read-only** PAT. Switch to **Repo Read, Write, Delete** only for a workspace that needs agents to edit repository text.

## Write access

The connection is read-only when you add it. To let agents update repository descriptions:

1. Reconnect with a **Repo Read, Write, Delete** PAT.
2. In **More → Workspace settings → Connections**, select **Docker Hub** and turn on the **Allow writes** switch on its detail panel.

Each update then goes through your [Rules](https://docs.cloudthinker.io/guide/approvals/rules.md) and [Approval mode](https://docs.cloudthinker.io/guide/approvals/approval-mode.md). The agent shows the current text and the exact new text before it asks.

Even with writes on, agents can only change a repository's short description and overview. They can't push, pull, delete, or rename images, change visibility, create or delete repositories, or manage members and tokens.

> [!WARNING]
>
> CloudThinker limits what agents do with the token, not what the token can do. A **Repo Read, Write, Delete** PAT can delete repositories if it leaks. Use one only where you need description edits, and give it a short expiration.

## Agent capabilities

| Capability | What agents can do |
| - | - |
| **Account discovery** | Identify your personal namespace and the organization namespaces the token can reach |
| **Repository inventory** | List repositories per namespace with visibility, lifetime pulls, stars, days since last push, and Docker Hub status (active or inactive) |
| **Tag inspection** | Show tag counts, compressed sizes, platforms, and push and pull dates for one repository |
| **Repository text** | Read a repository's description, and update its short description or overview when writes are on |

Read the numbers the way Docker Hub reports them:

* **Pulls** are lifetime totals. They can't show a trend or a spike.
* **Sizes** are compressed layer sizes, not storage used or runtime footprint.
* **Days since last push** is only push age. Docker Hub doesn't report what runs an image, so it can't prove a repository is unused.
* **Inactive** is Docker Hub's own marker for no push or pull in a month.

This connection doesn't report storage cost, vulnerabilities, or image signatures.

### Verify the connection

```text theme={null}
Discover my Docker Hub account and list each namespace with its repository count
```

Expect your personal namespace and any organization namespaces, each with private and public repository counts.

### Example prompts

```text theme={null}
List repositories in the acme namespace sorted by last push, with visibility and lifetime pulls
Inspect the tags of acme/api and show compressed size, platforms, and push and pull dates
```

## Troubleshooting

> [accordion] Invalid Docker Hub username
>
> You entered an email address or an organization name. Enter the account name that created the PAT.

> [accordion] Authentication failed
>
> The PAT is wrong, expired, deactivated, or deleted. Generate a new PAT and reconnect with the same username.

> [accordion] An organization namespace is missing
>
> Docker Hub refuses part of its organization listing for PAT-based sign-ins. That doesn't mean you have no organizations. Ask the agent to inspect the namespace by name, such as `acme`, and confirm the PAT's account is a member. If it works, the agent lists that namespace's repositories.

> [accordion] A private repository isn't found
>
> Check the full name, `NAMESPACE/NAME`. Docker Hub also answers "not found" when the PAT's account can't read a private repository.

> [accordion] A description update is refused
>
> Check three things in order. The **Allow writes** switch on the connection's detail panel must be on. The PAT must be **Repo Read, Write, Delete**; a **Repo Read & Write** PAT is refused. No Rule in [Approvals](https://docs.cloudthinker.io/guide/approvals/overview.md) may deny the update.

> [accordion] 429 rate limited
>
> Docker Hub limited the requests. Wait a few minutes, then ask about one namespace or repository at a time.

## Security

* **Least privilege** — grant only the permissions the agents need for your use case; start read-only and widen later.
* **Read-only by default** — use read-only credentials unless you want agents to make changes through this connection.
* **Rotate credentials** — rotate keys and tokens on your normal schedule; CloudThinker picks up the new value when you update the connection.
* **Revoke on offboarding** — remove the credential at the provider when you delete a connection or a teammate leaves.

- **Prefer Repo Read-only**: a **Repo Read-only** PAT covers every read. Even a **Repo Read, Write, Delete** PAT can only change repository text through this connection.
- **Review PATs**: set an expiration and check last-used dates under **Account settings → Personal access tokens**. Deactivate tokens you no longer need.

## Related

> [card] [CircleCI](https://docs.cloudthinker.io/guide/connections/circleci.md)
>
> Pipeline status, failure logs, flaky tests, and approval-gated reruns.

> [card] [Connections overview](https://docs.cloudthinker.io/guide/connections/overview.md)
>
> How credentials, Allow writes, and Approvals work together.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.