Docker Hub Image API

The Image API from Docker Hub — 15 operation(s) for image.

GitHub OpenAPI
Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent with a free APIs.io key — sign in with GitHub, Google or LinkedIn. No form to fill in; signing in shares your email address with us (Privacy).

Operations 15

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /images/json List images on the Docker daemon · List Images #
Ask an LLM
“Which images are available on my Docker daemon?”
“Can I list only images that are not used by any container?”
Tell an agent
List all images on the daemon.
List images including intermediate layers with all set to {all}.
POST /build Build an image from a Dockerfile · Build an image #
Ask an LLM
“How do I build an image from a Dockerfile in a tar archive?”
“Can I build an image with a custom Dockerfile path and build arguments?”
Tell an agent
Build an image from a Dockerfile located at {dockerfile} in the build context.
Build an image named {t} from the remote Git repository {remote}.
POST /build/prune Delete builder build cache · Delete builder cache #
Ask an LLM
“How do I clean up the builder's build cache?”
“Can I remove unused build cache layers?”
Tell an agent destructive · confirm first
Prune the builder's build cache.
Remove all unused build cache.
POST /images/create Pull or import an image · Create an image #
Ask an LLM
“How do I pull an image from a registry?”
“Can I import an image from a tarball or URL?”
Tell an agent
Pull the image {fromImage} from the registry.
Import an image from {fromSrc} into repository {repo}.
GET /images/{name}/json Inspect an image's details · Inspect an image #
Ask an LLM
“What layers and configuration make up a given image?”
“Can I see low-level details of an image by its name or ID?”
Tell an agent
Inspect image {name}.
Show the configuration and layers of image {name}.
GET /images/{name}/history Show an image's layer history · Get the history of an image #
Ask an LLM
“Which parent layers make up an image?”
“Can I see the command history of an image's layers?”
Tell an agent
Show the layer history of image {name}.
List the parent layers of image {name}.
POST /images/{name}/push Push an image to a registry · Push an image #
Ask an LLM
“How do I push an image to a private registry?”
“Can I tag an image with a specific tag before pushing it?”
Tell an agent
Push image {name} to its registry.
Push image {name} tagged {tag} to the registry.
POST /images/{name}/tag Tag an image into a repository · Tag an image #
Ask an LLM
“How do I tag an image so it belongs to a repository?”
“Can I give an image a new tag without pushing it?”
Tell an agent
Tag image {name} as {tag}.
Add the {tag} tag to image {name} in repository {repo}.
DELETE /images/{name} Remove an image · Remove an image #
Ask an LLM
“How do I remove an image from the daemon?”
“Can I force-remove an image that is still referenced by stopped containers?”
Tell an agent destructive · confirm first
Remove image {name}.
Force-remove image {name} even if it is referenced by stopped containers.
GET /images/search Search Docker Hub for images · Search images #
Ask an LLM
“What images are available on Docker Hub?”
“Can I search Docker Hub for official or automated images?”
Tell an agent
Search Docker Hub for images matching {term}.
Find up to {limit} images on Docker Hub for {term}.
POST /images/prune Remove unused images · Delete unused images #
Ask an LLM
“How do I clean up images that are not referenced by any container?”
“Can I remove dangling images only?”
Tell an agent destructive · confirm first
Prune unused images.
Remove dangling images matching {filters}.
POST /commit Create an image from a container · Create a new image from a container #
Ask an LLM
“How do I save the state of a running container as a new image?”
“Can I commit a container with a custom entry point and working directory?”
Tell an agent
Commit container {container} into a new image named {repo}:{tag}.
Save container {container} as image {repo} with comment {comment}.
GET /images/{name}/get Export an image as a tarball · Export an image #
Ask an LLM
“How do I export a single image and its layers to a tarball?”
“Can I download an image's tarball for backup?”
Tell an agent
Export image {name} as a tarball.
Download the image layers of {name} to a tar file.
GET /images/get Export several images as a tarball · Export several images #
Ask an LLM
“How do I export multiple images at once?”
“Can I get the tarball for several repositories together?”
Tell an agent
Export images {names} as one tarball.
Download the image archives for {names} in a single archive.
POST /images/load Import images from a tarball · Import images #
Ask an LLM
“How do I load images back into the daemon from a tarball?”
“Can I import an image archive I exported earlier?”
Tell an agent
Load images from the exported archive.
Import the image archive {archive} into the daemon.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/docker-hub:docker-hub-image-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

docker-hub-image-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Docker Engine Image API
  version: '1.33'
  x-logo:
    url: https://docs.docker.com/images/logo-docker-main.png
  description: 'The Engine API is an HTTP API served by Docker Engine. It is the API the Docker client uses to communicate with the Engine, so everything the Docker client can do can be done with the API.


    Most of the client''s commands map directly to API endpoints (e.g. `docker ps` is `GET /containers/json`). The notable exception is running containers, which consists of several API calls.


    # Errors


    The API uses standard HTTP status codes to indicate the success or failure of the API call. The body of the response will be JSON in the following format:


    ```

    {

    "message": "page not found"

    }

    ```


    # Versioning


    The API is usually changed in each release of Docker, so API calls are versioned to ensure that clients don''t break.


    For Docker Engine 17.09, the API version is 1.32. To lock to this version, you prefix the URL with `/v1.32`. For example, calling `/info` is the same as calling `/v1.32/info`.


    Engine releases in the near future should support this version of the API, so your client will continue to work even if it is talking to a newer Engine.


    In previous versions of Docker, it was possible to access the API without providing a version. This behaviour is now deprecated will be removed in a future version of Docker.


    The API uses an open schema model, which means server may add extra properties to responses. Likewise, the server will ignore any extra query parameters and request body properties. When you write clients, you need to ignore additional properties in responses to ensure they do not break when talking to newer Docker daemons.


    This documentation is for version 1.33 of the API. Use this table to find documentation for previous versions of the API:


    Docker version | API version | Changes

    ----------------|-------------|---------

    17.09.x | 1.31 | API changes

    17.07.x | 1.31 | API changes

    17.06.x | 1.30 | API changes

    17.05.x | 1.29 | API changes

    17.04.x | 1.28 | API changes

    17.03.1 | 1.27 | API changes

    1.13.1 & 17.03.0 | 1.26 | API changes

    1.13.0 | 1.25 | API changes

    1.12.x | 1.24 | API changes

    1.11.x | 1.23 | API changes

    1.10.x | 1.22 | API changes

    1.9.x | 1.21 | API changes

    1.8.x | 1.20 | API changes

    1.7.x | 1.19 | API changes

    1.6.x | 1.18 | API changes


    # Authentication


    Authentication for registries is handled client side. The client has to send authentication details to various endpoints that need to communicate with registries, such as `POST /images/(name)/push`. These are sent as `X-Registry-Auth` header as a Base64 encoded (JSON) string with the following structure:


    ```

    {

    "username": "string",

    "password": "string",

    "email": "string",

    "serveraddress": "string"

    }

    ```


    The `serveraddress` is a domain/IP without a protocol. Throughout this structure, double quotes are required.


    If you have already got an identity token from the `/auth` endpoint, you can just pass this instead of credentials:


    ```

    {

    "identitytoken": "9cbaf023786cd7..."

    }

    ```'
servers:
- url: /v1.33
tags:


# --- truncated at 32 KB (46 KB total) ---
# Full source: https://artifacts.apis.io/docker-hub/openapi/docker-hub-image-api-openapi.yml