# Export an image


[API catalog](/reference/api/) · [Docker Engine overview](/reference/api/engine/version/v1.57/) · [Product manual](https://docs.docker.com/engine/) · [OpenAPI specification](/reference/api/engine/version/v1.57.yaml)

API version: 1.57





`GET /images/{name}/get`

Get a tarball containing all images and metadata for a repository.

If `name` is a specific name and tag (e.g. `ubuntu:latest`), then only that image (and its parents) are returned. If `name` is an image ID, similarly only that image (and its parents) are returned, but with the exclusion of the `repositories` file in the tarball, as there were no image names referenced.

### Image tarball format

An image tarball contains [Content as defined in the OCI Image Layout Specification](https://github.com/opencontainers/image-spec/blob/v1.1.1/image-layout.md#content).

Additionally, includes the manifest.json file associated with a backwards compatible docker save format.

If the tarball defines a repository, the tarball should also include a `repositories` file at the root that contains a list of repository and tag names mapped to layer IDs.

```json
{
  "hello-world": {
    "latest": "565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1"
  }
}
```


## Connection and access

[API connection and authentication guidance](/reference/api/engine/version/v1.57/#connection)


Server: `/v1.57`

Effective security: alternatives are OR; schemes within an alternative are AND. An empty array declares no HTTP authentication requirement.

```json
null
```

## Example request

Replace placeholders and provide the required credentials or request body.

```console
curl \
  --request GET \
  --unix-socket "${DOCKER_SOCKET:-/var/run/docker.sock}" \
  --header 'Accept: application/x-tar' \
  'http://localhost/v1.57/images/<NAME>/get'
```



## Parameters

### name

Location: path. Required: yes.

Image name or ID

```json
{
  "description": "Image name or ID",
  "in": "path",
  "name": "name",
  "pointer": "/paths/~1images~1{name}~1get/get/parameters/0",
  "required": true,
  "schema": {
    "type": "string"
  }
}
```

### platform

Location: query. Required: no.

JSON encoded OCI platform describing a platform which will be used
to select a platform-specific image to be saved if the image is
multi-platform.
If not provided, the full multi-platform image will be saved.

Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}`


```json
{
  "description": "JSON encoded OCI platform describing a platform which will be used\nto select a platform-specific image to be saved if the image is\nmulti-platform.\nIf not provided, the full multi-platform image will be saved.\n\nExample: `{\"os\": \"linux\", \"architecture\": \"arm\", \"variant\": \"v5\"}`\n",
  "explode": true,
  "in": "query",
  "name": "platform",
  "pointer": "/paths/~1images~1{name}~1get/get/parameters/1",
  "schema": {
    "items": {
      "type": "string"
    },
    "type": "array"
  },
  "style": "form"
}
```

## Request and responses

### Response 200 application/x-tar

no error


Schema:

```json
{
  "format": "binary",
  "type": "string"
}
```










### Response 500 application/json

server error


Schema:

```json
{
  "$ref": "#/components/schemas/ErrorResponse"
}
```









Schema example:
```json
{
  "message": "Something went wrong."
}
```


## Complete operation contract

```json
{
  "description": "Get a tarball containing all images and metadata for a repository.\n\nIf `name` is a specific name and tag (e.g. `ubuntu:latest`), then only that image (and its parents) are returned. If `name` is an image ID, similarly only that image (and its parents) are returned, but with the exclusion of the `repositories` file in the tarball, as there were no image names referenced.\n\n### Image tarball format\n\nAn image tarball contains [Content as defined in the OCI Image Layout Specification](https://github.com/opencontainers/image-spec/blob/v1.1.1/image-layout.md#content).\n\nAdditionally, includes the manifest.json file associated with a backwards compatible docker save format.\n\nIf the tarball defines a repository, the tarball should also include a `repositories` file at the root that contains a list of repository and tag names mapped to layer IDs.\n\n```json\n{\n  \"hello-world\": {\n    \"latest\": \"565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1\"\n  }\n}\n```\n",
  "operationId": "ImageGet",
  "parameters": [
    {
      "description": "Image name or ID",
      "in": "path",
      "name": "name",
      "required": true,
      "schema": {
        "type": "string"
      }
    },
    {
      "description": "JSON encoded OCI platform describing a platform which will be used\nto select a platform-specific image to be saved if the image is\nmulti-platform.\nIf not provided, the full multi-platform image will be saved.\n\nExample: `{\"os\": \"linux\", \"architecture\": \"arm\", \"variant\": \"v5\"}`\n",
      "explode": true,
      "in": "query",
      "name": "platform",
      "schema": {
        "items": {
          "type": "string"
        },
        "type": "array"
      },
      "style": "form"
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/x-tar": {
          "schema": {
            "format": "binary",
            "type": "string"
          }
        }
      },
      "description": "no error"
    },
    "500": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "server error"
    }
  },
  "summary": "Export an image",
  "tags": [
    "Image"
  ]
}
```

## Referenced schemas

- [#/components/schemas/ErrorResponse](/reference/api/engine/version/v1.57/schemas/ErrorResponse/)




