Docker Container API

Create and manage containers.

GitHub OpenAPI

Operations 25

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 /containers/json List containers · List containers #
Ask an LLM
“Which containers are running on my Docker host?”
“Can I list containers that have been stopped too?”
Tell an agent
List all containers on the host.
Show the first {limit} containers created, including stopped ones.
POST /containers/create Create a container · Create a container #
Ask an LLM
“How do I create a container from an image?”
“Can I set environment variables and a command when creating a container?”
Tell an agent
Create a container from image {image}.
Create container {name} from {image} with command {cmd}.
GET /containers/{id}/json Inspect a container · Inspect a container #
Ask an LLM
“What are the details of a container, like its IP and status?”
“Can I see the size of a container's filesystem?”
Tell an agent
Inspect container {id}.
Show the size of container {id}.
GET /containers/{id}/top List processes in a container · List processes running inside a container #
Ask an LLM
“Which processes are running inside a container?”
“Can I sort a container's processes with a custom ps command?”
Tell an agent
List processes in container {id}.
Show processes in container {id} sorted by {ps_args}.
GET /containers/{id}/logs Get a container's logs · Get container logs #
Ask an LLM
“Where can I read the output of a container?”
“Can I follow a container's logs in real time?”
Tell an agent
Get logs for container {id}.
Follow container {id}'s logs since {since}.
GET /containers/{id}/changes See changes to a container's filesystem · Get changes on a container’s filesystem #
Ask an LLM
“What files were added, changed or deleted in a container?”
“Can I audit filesystem changes inside a container?”
Tell an agent
Show filesystem changes in container {id}.
List what changed in container {id}.
GET /containers/{id}/export Export a container's filesystem · Export a container #
Ask an LLM
“Can I export a container's filesystem as a tarball?”
“How do I save a container's filesystem for backup?”
Tell an agent
Export container {id} as a tarball.
Save the filesystem of container {id} to a file.
GET /containers/{id}/stats Get a container's resource usage · Get container stats based on resource usage #
Ask an LLM
“How much CPU and memory is a container using?”
“Can I get live resource usage for a container?”
Tell an agent
Get resource usage stats for container {id}.
Show live stats for container {id} with stream {stream}.
POST /containers/{id}/resize Resize a container's TTY · Resize a container TTY #
Ask an LLM
“Can I resize the terminal window of a container?”
“How do I change the height and width of a container's TTY?”
Tell an agent
Resize container {id}'s TTY to {h} rows by {w} columns.
Make the terminal of container {id} {h} tall and {w} wide.
POST /containers/{id}/start Start a container · Start a container #
Ask an LLM
“How do I start a stopped container?”
“Can I change the detach keys when starting a container?”
Tell an agent
Start container {id}.
Start container {id} and detach with keys {detachKeys}.
POST /containers/{id}/stop Stop a container · Stop a container #
Ask an LLM
“How do I stop a container gracefully?”
“Can I send a custom signal or timeout when stopping a container?”
Tell an agent destructive · confirm first
Stop container {id}.
Stop container {id} with signal {signal} after {t} seconds.
POST /containers/{id}/restart Restart a container · Restart a container #
Ask an LLM
“How do I restart a container?”
“Can I restart a container with a custom signal and timeout?”
Tell an agent
Restart container {id}.
Restart container {id} with signal {signal} after {t} seconds.
POST /containers/{id}/kill Kill a container with a signal · Kill a container #
Ask an LLM
“How do I kill a container with a SIGTERM or SIGKILL?”
“Can I send a custom signal to a container?”
Tell an agent destructive · confirm first
Kill container {id}.
Send signal {signal} to container {id}.
POST /containers/{id}/update Update a running container's settings · Update a container #
Ask an LLM
“Can I change a container's CPU or memory limits without recreating it?”
“How do I update a container's restart policy?”
Tell an agent
Set container {id}'s CPU shares to {cpuShares}.
Update container {id}'s restart policy to {restartPolicy}.
POST /containers/{id}/rename Rename a container · Rename a container #
Ask an LLM
“How do I rename a container?”
“Can I give a container a new name after it's created?”
Tell an agent
Rename container {id} to {name}.
Give container {id} the new name {name}.
POST /containers/{id}/pause Pause a container · Pause a container #
Ask an LLM
“How do I pause a container so it stops running but keeps its state?”
“Can I freeze a container's processes without killing it?”
Tell an agent
Pause container {id}.
Freeze all processes in container {id}.
POST /containers/{id}/unpause Unpause a container · Unpause a container #
Ask an LLM
“How do I resume a paused container?”
“Can I unfreeze a container's processes?”
Tell an agent
Unpause container {id}.
Resume the frozen processes in container {id}.
POST /containers/{id}/attach Attach to a container's streams · Attach to a container #
Ask an LLM
“How do I attach to a container's stdin, stdout and stderr?”
“Can I replay a container's logs when attaching?”
Tell an agent
Attach to container {id} and stream its output.
Attach to container {id} and replay its logs.
GET /containers/{id}/attach/ws Attach to a container over a websocket · Attach to a container via a websocket #
Ask an LLM
“Can I attach to a container using a websocket for real-time output?”
“Is there a websocket endpoint for container attachment?”
Tell an agent
Connect to container {id} over websocket.
Attach to container {id} via websocket and stream its output.
POST /containers/{id}/wait Wait for a container to stop · Wait for a container #
Ask an LLM
“How do I wait until a container exits and get its exit code?”
“Can I wait for a container to reach a certain state?”
Tell an agent
Wait for container {id} to stop.
Wait for container {id} until it reaches {condition}.
DELETE /containers/{id} Remove a container · Remove a container #
Ask an LLM
“How do I remove a stopped container?”
“Can I force-remove a container that is still running?”
Tell an agent destructive · confirm first
Remove container {id}.
Remove container {id} and its anonymous volumes.
HEAD /containers/{id}/archive Get file info for a path in a container · Get information about files in a container #
Ask an LLM
“What are the file stats for a path inside a container?”
“Can I check whether a file exists in a container?”
Tell an agent
Get file info for {path} in container {id}.
Check if {path} exists in container {id}.
GET /containers/{id}/archive Download a file or directory from a container · Get an archive of a filesystem resource in a container #
Ask an LLM
“How do I download a file from inside a container?”
“Can I get a tar archive of a directory in a container?”
Tell an agent
Get a tar archive of {path} in container {id}.
Download the file {path} from container {id}.
PUT /containers/{id}/archive Upload a tar archive into a container · Extract an archive of files or folders to a directory in a container #
Ask an LLM
“How do I upload a tar archive into a container?”
“Can I extract an archive into a directory inside a container?”
Tell an agent
Extract {path} from this archive into container {id}.
Upload a tar archive to {path} in container {id}.
POST /containers/prune Delete stopped containers · Delete stopped containers #
Ask an LLM
“How do I clean up stopped containers?”
“Can I prune containers created before a certain time?”
Tell an agent destructive · confirm first
Prune stopped containers.
Prune containers older than {filters}.

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:docker-container-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-container-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Docker Engine Container API
  version: '1.54'
  x-logo:
    url: https://docs.docker.com/assets/images/logo-docker-main.png
  description: The Engine API is an HTTP API served by Docker Engine.
servers:
- url: /v1.54
tags:


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