mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
image: improve godoc for V1Image
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
34c2c14775
commit
06df530b6d
1 changed files with 53 additions and 17 deletions
|
@ -36,38 +36,73 @@ func IDFromDigest(digest digest.Digest) ID {
|
||||||
type V1Image struct {
|
type V1Image struct {
|
||||||
// ID is a unique 64 character identifier of the image
|
// ID is a unique 64 character identifier of the image
|
||||||
ID string `json:"id,omitempty"`
|
ID string `json:"id,omitempty"`
|
||||||
// Parent is the ID of the parent image
|
|
||||||
|
// Parent is the ID of the parent image.
|
||||||
|
//
|
||||||
|
// Depending on how the image was created, this field may be empty and
|
||||||
|
// is only set for images that were built/created locally. This field
|
||||||
|
// is empty if the image was pulled from an image registry.
|
||||||
Parent string `json:"parent,omitempty"`
|
Parent string `json:"parent,omitempty"`
|
||||||
// Comment is the commit message that was set when committing the image
|
|
||||||
|
// Comment is an optional message that can be set when committing or
|
||||||
|
// importing the image.
|
||||||
Comment string `json:"comment,omitempty"`
|
Comment string `json:"comment,omitempty"`
|
||||||
|
|
||||||
// Created is the timestamp at which the image was created
|
// Created is the timestamp at which the image was created
|
||||||
Created time.Time `json:"created"`
|
Created time.Time `json:"created"`
|
||||||
// Container is the id of the container used to commit
|
|
||||||
|
// 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.
|
||||||
Container string `json:"container,omitempty"`
|
Container string `json:"container,omitempty"`
|
||||||
// ContainerConfig is the configuration of the container that is committed into the image
|
|
||||||
|
// ContainerConfig is the configuration of the container that was committed
|
||||||
|
// into the image.
|
||||||
ContainerConfig container.Config `json:"container_config,omitempty"`
|
ContainerConfig container.Config `json:"container_config,omitempty"`
|
||||||
// DockerVersion specifies the version of Docker that was used to build the image
|
|
||||||
|
// DockerVersion is the version of Docker that was used to build the image.
|
||||||
|
//
|
||||||
|
// Depending on how the image was created, this field may be empty.
|
||||||
DockerVersion string `json:"docker_version,omitempty"`
|
DockerVersion string `json:"docker_version,omitempty"`
|
||||||
// Author is the name of the author that was specified when committing the image
|
|
||||||
|
// Author is the name of the author that was specified when committing the
|
||||||
|
// image, or as specified through MAINTAINER (deprecated) in the Dockerfile.
|
||||||
Author string `json:"author,omitempty"`
|
Author string `json:"author,omitempty"`
|
||||||
// Config is the configuration of the container received from the client
|
|
||||||
|
// Config is the configuration of the container received from the client.
|
||||||
Config *container.Config `json:"config,omitempty"`
|
Config *container.Config `json:"config,omitempty"`
|
||||||
// Architecture is the hardware that the image is built and runs on
|
|
||||||
|
// Architecture is the hardware CPU architecture that the image runs on.
|
||||||
Architecture string `json:"architecture,omitempty"`
|
Architecture string `json:"architecture,omitempty"`
|
||||||
// Variant is the CPU architecture variant (presently ARM-only)
|
|
||||||
|
// Variant is the CPU architecture variant (presently ARM-only).
|
||||||
Variant string `json:"variant,omitempty"`
|
Variant string `json:"variant,omitempty"`
|
||||||
// OS is the operating system used to build and run the image
|
|
||||||
|
// OS is the Operating System the image is built to run on.
|
||||||
OS string `json:"os,omitempty"`
|
OS string `json:"os,omitempty"`
|
||||||
// Size is the total size of the image including all layers it is composed of
|
|
||||||
|
// Size is the total size of the image including all layers it is composed of.
|
||||||
Size int64 `json:",omitempty"`
|
Size int64 `json:",omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Image stores the image configuration
|
// Image stores the image configuration
|
||||||
type Image struct {
|
type Image struct {
|
||||||
V1Image
|
V1Image
|
||||||
|
|
||||||
|
// Parent is the ID of the parent image.
|
||||||
|
//
|
||||||
|
// Depending on how the image was created, this field may be empty and
|
||||||
|
// is only set for images that were built/created locally. This field
|
||||||
|
// is empty if the image was pulled from an image registry.
|
||||||
Parent ID `json:"parent,omitempty"` //nolint:govet
|
Parent ID `json:"parent,omitempty"` //nolint:govet
|
||||||
|
|
||||||
|
// RootFS contains information about the image's RootFS, including the
|
||||||
|
// layer IDs.
|
||||||
RootFS *RootFS `json:"rootfs,omitempty"`
|
RootFS *RootFS `json:"rootfs,omitempty"`
|
||||||
History []History `json:"history,omitempty"`
|
History []History `json:"history,omitempty"`
|
||||||
|
|
||||||
|
// OsVersion is the version of the Operating System the image is built to
|
||||||
|
// run on (especially for Windows).
|
||||||
OSVersion string `json:"os.version,omitempty"`
|
OSVersion string `json:"os.version,omitempty"`
|
||||||
OSFeatures []string `json:"os.features,omitempty"`
|
OSFeatures []string `json:"os.features,omitempty"`
|
||||||
|
|
||||||
|
@ -195,7 +230,8 @@ func NewChildImage(img *Image, child ChildConfig, os string) *Image {
|
||||||
type History struct {
|
type History struct {
|
||||||
// Created is the timestamp at which the image was created
|
// Created is the timestamp at which the image was created
|
||||||
Created time.Time `json:"created"`
|
Created time.Time `json:"created"`
|
||||||
// Author is the name of the author that was specified when committing the image
|
// Author is the name of the author that was specified when committing the
|
||||||
|
// image, or as specified through MAINTAINER (deprecated) in the Dockerfile.
|
||||||
Author string `json:"author,omitempty"`
|
Author string `json:"author,omitempty"`
|
||||||
// CreatedBy keeps the Dockerfile command used while building the image
|
// CreatedBy keeps the Dockerfile command used while building the image
|
||||||
CreatedBy string `json:"created_by,omitempty"`
|
CreatedBy string `json:"created_by,omitempty"`
|
||||||
|
|
Loading…
Reference in a new issue