Remove a container Run in API Explorer

DELETE /containers/{id}

Path parameters

  • id string Required

    ID or name of the container

Query parameters

  • v boolean

    Remove anonymous volumes associated with the container.

    Default value is false.

  • force boolean

    If the container is running, kill it before removing it.

    Default value is false.

Responses

  • 204

    no error

  • 400 application/json

    bad parameter

    Hide response attribute Show response attribute object
    • message string Required

      The error message.

  • 404 application/json

    no such container

    Hide response attribute Show response attribute object
    • message string Required

      The error message.

  • 409 application/json

    conflict

    Hide response attribute Show response attribute object
    • message string Required

      The error message.

  • 500 application/json

    server error

    Hide response attribute Show response attribute object
    • message string Required

      The error message.

DELETE /containers/{id}
curl \
 --request DELETE 'http://api.example.com/v1.44/containers/{id}'
Response examples (400)
{
  "message": "Something went wrong."
}
Response examples (400)
{
  "message": "Something went wrong."
}
Response examples (404)
{
  "message": "No such container: c2ada9df5af8"
}
Response examples (404)
{
  "message": "Something went wrong."
}
Response examples (409)
{
  "message": "You cannot remove a running container: c2ada9df5af8. Stop the\ncontainer before attempting removal or force remove\n"
}
Response examples (409)
{
  "message": "Something went wrong."
}
Response examples (500)
{
  "message": "Something went wrong."
}
Response examples (500)
{
  "message": "Something went wrong."
}