Skip to content

Commit

Permalink
c8d: show the real image creation date when listing images
Browse files Browse the repository at this point in the history
Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
  • Loading branch information
rumpl committed Oct 25, 2023
1 parent dcc8020 commit 8f756fe
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions daemon/containerd/image_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ import (

// Subset of ocispec.Image that only contains Labels
type configLabels struct {
// Created is the combined date and time at which the image was created, formatted as defined by RFC 3339, section 5.6.
Created *time.Time `json:"created,omitempty"`

Config struct {
Labels map[string]string `json:"Labels,omitempty"`
} `json:"config,omitempty"`
Expand Down Expand Up @@ -277,9 +280,8 @@ func (i *ImageService) singlePlatformImage(ctx context.Context, contentStore con
}

summary := &imagetypes.Summary{
ParentID: "",
ParentID: rawImg.Labels[imageLabelClassicBuilderParent],
ID: target.String(),
Created: rawImg.CreatedAt.Unix(),
RepoDigests: repoDigests,
RepoTags: repoTags,
Size: totalSize,
Expand All @@ -291,6 +293,9 @@ func (i *ImageService) singlePlatformImage(ctx context.Context, contentStore con
SharedSize: -1,
Containers: -1,
}
if cfg.Created != nil {
summary.Created = cfg.Created.Unix()
}

if opts.ContainerCount {
// Get container count
Expand Down

0 comments on commit 8f756fe

Please sign in to comment.