Skip to content

Commit 1602e2f

Browse files
committed
api: Deprecate Container and ContainerConfig for /images/{id}/json
These fields were an implementation detail of the classic image builder and are empty when using buildkit. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
1 parent debcb76 commit 1602e2f

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

api/server/router/image/image_routes.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,8 @@ func (ir *imageRouter) toImageInspect(img *image.Image) (*types.ImageInspect, er
338338
Parent: img.Parent.String(),
339339
Comment: comment,
340340
Created: created,
341-
Container: img.Container,
342-
ContainerConfig: &img.ContainerConfig,
341+
Container: img.Container, //nolint:staticcheck // ignore SA1019: field is deprecated, but still set on API < v1.45.
342+
ContainerConfig: &img.ContainerConfig, //nolint:staticcheck // ignore SA1019: field is deprecated, but still set on API < v1.45.
343343
DockerVersion: img.DockerVersion,
344344
Author: img.Author,
345345
Config: img.Config,

api/swagger.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1744,10 +1744,15 @@ definitions:
17441744
The ID of the container that was used to create the image.
17451745
17461746
Depending on how the image was created, this field may be empty.
1747+
1748+
**Deprecated**: this field is kept for backward compatibility, but
1749+
will be removed in API v1.45.
17471750
type: "string"
1748-
x-nullable: false
17491751
example: "65974bc86f1770ae4bff79f651ebdbce166ae9aada632ee3fa9af3a264911735"
17501752
ContainerConfig:
1753+
description: |
1754+
**Deprecated**: this field is kept for backward compatibility, but
1755+
will be removed in API v1.45.
17511756
$ref: "#/definitions/ContainerConfig"
17521757
DockerVersion:
17531758
description: |

api/types/types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,17 @@ type ImageInspect struct {
7777
// Container is the ID of the container that was used to create the image.
7878
//
7979
// Depending on how the image was created, this field may be empty.
80+
//
81+
// Deprecated: this field is omitted in API v1.45, but kept for backward compatibility.
8082
Container string
8183

8284
// ContainerConfig is an optional field containing the configuration of the
8385
// container that was last committed when creating the image.
8486
//
8587
// Previous versions of Docker builder used this field to store build cache,
8688
// and it is not in active use anymore.
89+
//
90+
// Deprecated: this field is omitted in API v1.45, but kept for backward compatibility.
8791
ContainerConfig *container.Config
8892

8993
// DockerVersion is the version of Docker that was used to build the image.

docs/api/version-history.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ keywords: "API, Docker, rcli, REST, documentation"
6565
The container-wide `MacAddress` field in `Config`, on `POST /containers/create`, is now deprecated.
6666
* The field `Networks` in the `POST /services/create` and `POST /services/{id}/update`
6767
requests is now deprecated. You should instead use the field `TaskTemplate.Networks`.
68+
* The `Container` and `ContainerConfig` fields in the `GET /images/{name}/json`
69+
response are deprecated and will no longer be included in API v1.45.
6870

6971
## v1.43 API changes
7072

0 commit comments

Comments
 (0)