Docker hub

Learn how to use Docker hub with Composio

Overview

SLUG: DOCKER_HUB

Description

Docker Hub is a service provided by Docker for finding and sharing container images with your team.

Authentication Details

generic_api_key
stringRequired

Connecting to Docker hub

Create an auth config

Use the dashboard to create an auth config for the Docker hub toolkit. This allows you to connect multiple Docker hub accounts to Composio for agents to use.

1

Select App

Navigate to [Docker hub](https://platform.composio.dev?next_page=/marketplace/Docker hub).

2

Configure Auth Config Settings

Select among the supported auth schemes of and configure them here.

3

Create and Get auth config ID

Click “Create Docker hub Auth Config”. After creation, copy the displayed ID starting with ac_. This is your auth config ID. This is not a sensitive ID — you can save it in environment variables or a database. This ID will be used to create connections to the toolkit for a given user.

Connect Your Account

Using API Key

1from composio import Composio
2
3# Replace these with your actual values
4docker_hub_auth_config_id = "ac_YOUR_DOCKER_HUB_CONFIG_ID" # Auth config ID created above
5user_id = "0000-0000-0000" # UUID from database/app
6
7composio = Composio()
8
9def authenticate_toolkit(user_id: str, auth_config_id: str):
10 # Replace this with a method to retrieve an API key from the user.
11 # Or supply your own.
12 user_api_key = input("[!] Enter API key")
13
14 connection_request = composio.connected_accounts.initiate(
15 user_id=user_id,
16 auth_config_id=auth_config_id,
17 config={"auth_scheme": "API_KEY", "val": {"generic_api_key": user_api_key}}
18 )
19
20 # API Key authentication is immediate - no redirect needed
21 print(f"Successfully connected Docker hub for user {user_id}")
22 print(f"Connection status: {connection_request.status}")
23
24 return connection_request.id
25
26
27connection_id = authenticate_toolkit(user_id, docker_hub_auth_config_id)
28
29# You can verify the connection using:
30connected_account = composio.connected_accounts.get(connection_id)
31print(f"Connected account: {connected_account}")

Tools

Executing tools

To prototype you can execute some tools to see the responses and working on the [Docker hub toolkit’s playground](https://app.composio.dev/app/Docker hub)

Python
1from composio import Composio
2from openai import OpenAI
3import json
4
5openai = OpenAI()
6composio = Composio()
7
8# User ID must be a valid UUID format
9user_id = "0000-0000-0000" # Replace with actual user UUID from your database
10
11tools = composio.tools.get(user_id=user_id, toolkits=["DOCKER_HUB"])
12
13print("[!] Tools:")
14print(json.dumps(tools))
15
16def invoke_llm(task = "What can you do?"):
17 completion = openai.chat.completions.create(
18 model="gpt-4o",
19 messages=[
20 {
21 "role": "user",
22 "content": task, # Your task here!
23 },
24 ],
25 tools=tools,
26 )
27
28 # Handle Result from tool call
29 result = composio.provider.handle_tool_calls(user_id=user_id, response=completion)
30 print(f"[!] Completion: {completion}")
31 print(f"[!] Tool call result: {result}")
32
33invoke_llm()

Tool List

Tool Name: Add Organization Member

Description

Tool to send an invitation for a user to join a Docker Hub organization. Use when you need to grant membership by inviting a user via their username after choosing the appropriate role.

Action Parameters

invitee_username
stringRequired
organization_name
stringRequired
role
stringDefaults to member

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create Docker Hub Organization

Description

Tool to create a Docker Hub organization. Use when you need to programmatically instantiate a new namespace for organizing repositories.

Action Parameters

description
string
full_description
string
location
string
name
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create Docker Hub Repository

Description

Tool to create a Docker Hub repository under a namespace. Use when you need to programmatically instantiate a new repo under your organization or user.

Action Parameters

description
string
full_description
string
is_private
boolean
name
stringRequired
namespace
stringRequired
registry
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create Docker Hub Webhook

Description

Tool to create a webhook on a Docker Hub repository. Use after determining repository details.

Action Parameters

active
booleanDefaults to True
events
arrayDefaults to ['push']
name
string
namespace
stringRequired
repository
stringRequired
target_url
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete Repository Image

Description

Tool to delete a specific image within a Docker Hub repository. Use when you have confirmed the namespace, repository, and image ID to remove.

Action Parameters

image_id
integerRequired
namespace
stringRequired
repository
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete Docker Hub Organization

Description

Tool to delete a specific Docker Hub organization. Use when you need to permanently remove an organization. Deletion is irreversible.

Action Parameters

organization
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete Docker Hub Repository

Description

Tool to delete a specific Docker Hub repository. Use when you need to permanently remove a repository. Deletion is irreversible.

Action Parameters

namespace
stringRequired
repository
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete Repository Tag

Description

Tool to delete a specific tag from a Docker Hub repository. Use after confirming the tag to remove.

Action Parameters

namespace
stringRequired
repository
stringRequired
tag
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete Docker Hub Team

Description

Tool to delete a specific team from an organization. Use after confirming the team exists in Docker Hub.

Action Parameters

org_name
stringRequired
team_name
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete Docker Hub repository webhook

Description

Tool to delete a specific webhook from a repository. Use when cleaning up outdated or misconfigured webhooks.

Action Parameters

namespace
stringRequired
repository
stringRequired
webhook_id
integerRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Docker Hub Image

Description

Tool to retrieve detailed information about a specific image within a Docker Hub repository. Use after confirming namespace, repository name, and image ID. Example: GET_IMAGE(namespace="library", repository="ubuntu", image_id="sha256:...")

Action Parameters

image_id
stringRequired
namespace
stringRequired
repository
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Organization Details

Description

Tool to retrieve details of a specific organization namespace. Use when you have the organization slug and need its namespace metadata.

Action Parameters

organization
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Docker Hub Repository

Description

Tool to retrieve details of a specific Docker Hub repository. Use after confirming namespace and repository name.

Action Parameters

namespace
stringRequired
repository
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Docker Hub Tag

Description

Tool to retrieve details of a specific Docker Hub repository tag. Use after confirming the namespace, repository, and tag name.

Action Parameters

namespace
stringRequired
repository
stringRequired
tag
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Docker Hub Team

Description

Tool to retrieve a specific Docker Hub team. Use after confirming the organization and team exist.

Action Parameters

org_name
stringRequired
team_name
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Docker Hub Webhook

Description

Tool to retrieve details of a specific Docker Hub webhook. Use when you need to inspect an existing webhook's configuration by its ID.

Action Parameters

namespace
stringRequired
repository
stringRequired
webhook_id
integerRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Repository Images

Description

Tool to list image variants for a specific Docker Hub repository. Use after specifying namespace and repository.

Action Parameters

namespace
stringRequired
page
integer
page_size
integer
repository
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Docker Hub Organizations

Description

Tool to list organizations (namespaces) for the authenticated user. Use after authentication to retrieve namespaces.

Action Parameters

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Docker Hub Organization Members

Description

Tool to list members of a Docker Hub organization. Use when managing or auditing organization membership.

Action Parameters

org
stringRequired
page
integerDefaults to 1
page_size
integerDefaults to 100

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Docker Hub Repositories

Description

Tool to list repositories under a namespace. Use when you need to enumerate repositories within a specific Docker Hub namespace, with optional filtering and pagination.

Action Parameters

content_types
string
media_types
string
namespace
stringRequired
ordering
string
page
integerDefaults to 1
page_size
integerDefaults to 25

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Repository Tags

Description

Tool to list tags for a Docker Hub repository. Use after specifying namespace and repository.

Action Parameters

namespace
stringRequired
page
integer
page_size
integer
repository
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Team Members

Description

Tool to list members of a Docker Hub team. Use when you need to retrieve all users in a specific team.

Action Parameters

org_name
stringRequired
team_slug
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Organization Teams

Description

Tool to list teams in a specific organization. Use after confirming the organization slug.

Action Parameters

organization
stringRequired
page
integerDefaults to 1
page_size
integerDefaults to 25

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Docker Hub repository webhooks

Description

Tool to list webhooks for a Docker Hub repository. Use when you need to retrieve all existing webhooks after confirming repository details.

Action Parameters

namespace
stringRequired
page
integer
page_size
integer
repository
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Remove Organization Member

Description

Tool to remove a user from a Docker Hub organization. Use when you need to revoke a user's existing membership after confirming the organization and username.

Action Parameters

org_name
stringRequired
username
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Remove Team Member

Description

Tool to remove a user from a Docker Hub team. Use when you need to revoke membership from a team after verifying the user is currently a member.

Action Parameters

org_name
stringRequired
team_slug
stringRequired
username
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired