-
Notifications
You must be signed in to change notification settings - Fork 18.8k
docs: api: use separate definition for Image.Config (api v1.39 - v1.45) #47942
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
thaJeztah
merged 2 commits into
moby:master
from
thaJeztah:api_swagger_update_image_config
Jun 10, 2024
Merged
docs: api: use separate definition for Image.Config (api v1.39 - v1.45) #47942
thaJeztah
merged 2 commits into
moby:master
from
thaJeztah:api_swagger_update_image_config
Jun 10, 2024
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 task
7fcaddd
to
052cc3d
Compare
vvoland
approved these changes
Jun 10, 2024
dvdksn
reviewed
Jun 10, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Image.Config field currently reuses the ContainerConfig definition, matching the Go implementation, which also uses that type. However, the ContainerConfig type contains various fields that are not part of the image config, and would never be set. The Image.Config is used as template / default values for containers started from the image, but will only use the fields that are part of the [Docker image spec]. This patch updates the swagger files used in the documentation to use a separate `ImageConfig` definition for the Image.Config field. The new definition is a copy of the existing `ContainerConfig` type, but with updated descriptions for fields, and with an example response that omits the fields that should not be used. The following fields are currently included in the `Config` field of the API response, but are not part of the underlying image's config: - `Hostname` - `Domainname` - `AttachStdin` - `AttachStdout` - `AttachStderr` - `Tty` - `OpenStdin` - `StdinOnce` - `Image` - `NetworkDisabled` (already omitted unless set) - `MacAddress` (already omitted unless set) - `StopTimeout` (already omitted unless set) [Docker image spec]: https://github.com/moby/docker-image-spec/blob/v1.3.1/specs-go/v1/image.go#L19-L32 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The Image.Config field currently reuses the ContainerConfig definition, matching the Go implementation, which also uses that type. However, the ContainerConfig type contains various fields that are not part of the image config, and would never be set. The Image.Config is used as template / default values for containers started from the image, but will only use the fields that are part of the [Docker image spec]. This patch updates the swagger files used in the documentation to use a separate `ImageConfig` definition for the Image.Config field. The new definition is a copy of the existing `ContainerConfig` type, but with updated descriptions for fields, and with an example response that omits the fields that should not be used. The following fields are currently included in the `Config` field of the API response, but are not part of the underlying image's config: - `Hostname` - `Domainname` - `AttachStdin` - `AttachStdout` - `AttachStderr` - `Tty` - `OpenStdin` - `StdinOnce` - `Image` - `NetworkDisabled` (already omitted unless set) - `MacAddress` (already omitted unless set) - `StopTimeout` (already omitted unless set) [Docker image spec]: https://github.com/moby/docker-image-spec/blob/v1.3.1/specs-go/v1/image.go#L19-L32 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
052cc3d
to
58641c7
Compare
@dvdksn updated; applied your suggestions, but I kept the |
dvdksn
approved these changes
Jun 10, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
GET /images/{name}/json
response #47941The Image.Config field currently reuses the ContainerConfig definition, matching the Go implementation, which also uses that type.
However, the ContainerConfig type contains various fields that are not part of the image config, and would never be set. The Image.Config is used as template / default values for containers started from the image, but will only use the fields that are part of the Docker image spec.
This patch updates the swagger files used in the documentation to use a separate
ImageConfig
definition for the Image.Config field. The new definition is a copy of the existingContainerConfig
type, but with updated descriptions for fields, and with an example response that omits the fields that should not be used.The following fields are currently included in the
Config
field of the API response, but are not part of the underlying image's config:Hostname
Domainname
AttachStdin
AttachStdout
AttachStderr
Tty
OpenStdin
StdinOnce
Image
NetworkDisabled
(already omitted unless set)MacAddress
(already omitted unless set)StopTimeout
(already omitted unless set)- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)