Skip to main content

Get Container Details

GET /api/containers/{id}?env=1
Retrieves detailed information about a specific container, including its configuration, state, and network settings.

Path Parameters

id
string
required
The container ID or name

Query Parameters

env
string
required
The environment ID where the container is located

Response

Returns a detailed container inspection object from the Docker API.
Id
string
Full container ID
Name
string
Container name (includes leading slash)
Created
string
ISO 8601 timestamp of when the container was created
Path
string
Command executable being run
Args
array
Command arguments
State
object
Container state information
Status
string
Current status (e.g., “running”, “exited”, “paused”)
Running
boolean
Whether the container is running
Paused
boolean
Whether the container is paused
Restarting
boolean
Whether the container is restarting
ExitCode
number
Exit code if the container has stopped
StartedAt
string
ISO 8601 timestamp of when the container started
FinishedAt
string
ISO 8601 timestamp of when the container finished
Image
string
Image ID
Config
object
Container configuration
Hostname
string
Container hostname
Env
array
Environment variables as strings in “KEY=value” format
Cmd
array
Command to run
Image
string
Image name and tag
Labels
object
Container labels
NetworkSettings
object
Network configuration
IPAddress
string
Primary IP address
Ports
object
Port mappings
Networks
object
Network attachments
Mounts
array
Volume mounts and bind mounts

Error Responses

error
string
Error message if the request fails
Status Codes:
  • 200 - Success
  • 403 - Permission denied
  • 500 - Failed to inspect container

Example

curl -X GET "https://your-dockhand.com/api/containers/abc123def456?env=1" \
  -H "Cookie: session=your-session-cookie"

Response Example

{
  "Id": "abc123def456789...",
  "Name": "/my-nginx",
  "Created": "2024-01-15T10:30:00.000Z",
  "State": {
    "Status": "running",
    "Running": true,
    "Paused": false,
    "Restarting": false,
    "ExitCode": 0,
    "StartedAt": "2024-01-15T10:30:01.000Z"
  },
  "Image": "sha256:abc123...",
  "Config": {
    "Hostname": "abc123def456",
    "Env": [
      "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
      "NGINX_VERSION=1.25.3"
    ],
    "Image": "nginx:latest",
    "Labels": {}
  },
  "NetworkSettings": {
    "IPAddress": "172.17.0.2",
    "Ports": {
      "80/tcp": [
        {
          "HostIp": "0.0.0.0",
          "HostPort": "8080"
        }
      ]
    }
  }
}

Inspect Container (Dedicated Endpoint)

GET /api/containers/{id}/inspect?env=1
Alternative endpoint that provides the same inspection functionality. Returns identical data to the main container details endpoint.

Path Parameters

id
string
required
The container ID or name

Query Parameters

env
string
required
The environment ID where the container is located

Response

Same response format as the main container details endpoint.

Example

curl -X GET "https://your-dockhand.com/api/containers/abc123def456/inspect?env=1" \
  -H "Cookie: session=your-session-cookie"

Delete Container

DELETE /api/containers/{id}?env=1&force=true
Removes a container from the specified environment. Also cleans up any associated auto-update schedules and pending updates.

Path Parameters

id
string
required
The container ID or name to delete

Query Parameters

env
string
required
The environment ID where the container is located
force
boolean
default:"false"
Force removal of a running container (using SIGKILL)

Response

success
boolean
Whether the container was successfully removed

Error Responses

error
string
Error message if the request fails
Status Codes:
  • 200 - Container deleted successfully
  • 403 - Permission denied
  • 500 - Failed to remove container

Example

curl -X DELETE "https://your-dockhand.com/api/containers/abc123def456?env=1&force=true" \
  -H "Cookie: session=your-session-cookie"

Response Example

{
  "success": true
}

Build docs developers (and LLMs) love