Skip to content

Commit

Permalink
Merge pull request moby#46939 from vvoland/api-deprecate-image-container
Browse files Browse the repository at this point in the history
api: Deprecate `Container` and `ContainerConfig` for `/images/{id}/json`
  • Loading branch information
thaJeztah authored Dec 14, 2023
2 parents f3cc936 + 1602e2f commit bd70d66
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
4 changes: 2 additions & 2 deletions api/server/router/image/image_routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,8 @@ func (ir *imageRouter) toImageInspect(img *image.Image) (*types.ImageInspect, er
Parent: img.Parent.String(),
Comment: comment,
Created: created,
Container: img.Container,
ContainerConfig: &img.ContainerConfig,
Container: img.Container, //nolint:staticcheck // ignore SA1019: field is deprecated, but still set on API < v1.45.
ContainerConfig: &img.ContainerConfig, //nolint:staticcheck // ignore SA1019: field is deprecated, but still set on API < v1.45.
DockerVersion: img.DockerVersion,
Author: img.Author,
Config: img.Config,
Expand Down
7 changes: 6 additions & 1 deletion api/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1744,10 +1744,15 @@ definitions:
The ID of the container that was used to create the image.
Depending on how the image was created, this field may be empty.
**Deprecated**: this field is kept for backward compatibility, but
will be removed in API v1.45.
type: "string"
x-nullable: false
example: "65974bc86f1770ae4bff79f651ebdbce166ae9aada632ee3fa9af3a264911735"
ContainerConfig:
description: |
**Deprecated**: this field is kept for backward compatibility, but
will be removed in API v1.45.
$ref: "#/definitions/ContainerConfig"
DockerVersion:
description: |
Expand Down
4 changes: 4 additions & 0 deletions api/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,17 @@ type ImageInspect struct {
// Container is the ID of the container that was used to create the image.
//
// Depending on how the image was created, this field may be empty.
//
// Deprecated: this field is omitted in API v1.45, but kept for backward compatibility.
Container string

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

// DockerVersion is the version of Docker that was used to build the image.
Expand Down
2 changes: 2 additions & 0 deletions docs/api/version-history.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ keywords: "API, Docker, rcli, REST, documentation"
The container-wide `MacAddress` field in `Config`, on `POST /containers/create`, is now deprecated.
* The field `Networks` in the `POST /services/create` and `POST /services/{id}/update`
requests is now deprecated. You should instead use the field `TaskTemplate.Networks`.
* The `Container` and `ContainerConfig` fields in the `GET /images/{name}/json`
response are deprecated and will no longer be included in API v1.45.

## v1.43 API changes

Expand Down

0 comments on commit bd70d66

Please sign in to comment.