Remove an image Run in API Explorer

DELETE /images/{name}

Remove an image, along with any untagged parent images that were referenced by that image.

Images can't be removed if they have descendant images, are being used by a running container or are being used by a build.

Path parameters

  • name string Required

    Image name or ID

Query parameters

  • force boolean

    Remove the image even if it is being used by stopped containers or has other tags

    Default value is false.

  • noprune boolean

    Do not delete untagged parent images

    Default value is false.

Responses

  • 200 application/json

    The image was deleted successfully

    Hide response attributes Show response attributes object
    • Untagged string

      The image ID of an image that was untagged

    • Deleted string

      The image ID of an image that was deleted

  • 404 application/json

    No such image

    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 /images/{name}
curl \
 --request DELETE 'http://api.example.com/v1.49/images/{name}'
Response examples (200)
[
  {
    "Untagged": "3e2f21a89f"
  },
  {
    "Deleted": "3e2f21a89f"
  },
  {
    "Deleted": "53b4f83ac9"
  }
]
Response examples (200)
[
  {
    "Untagged": "string",
    "Deleted": "string"
  }
]
Response examples (404)
{
  "message": "Something went wrong."
}
Response examples (404)
{
  "message": "Something went wrong."
}
Response examples (409)
{
  "message": "Something went wrong."
}
Response examples (409)
{
  "message": "Something went wrong."
}
Response examples (500)
{
  "message": "Something went wrong."
}
Response examples (500)
{
  "message": "Something went wrong."
}