Skip to content

[Proposal] Add a "last build time" field to image "metadata" #25728

@dnephin

Description

@dnephin

When an image is built for the first time, the Created time is set. If another build is performed, and the context hasn't changed, the result of the build will be a no-op. The old image will be used, and the Created time wont change.

Normally this is fine, but there are some cases when it is valuable to know the time the last build was performed, not just when the original cached image was created.

The use case that I've encountered is creating a build automation tool that uses docker (dobi). Using make to build images would have the same problem. Repeating the build (and hitting the cache) is fine for the "build image" step of the automation, but if there are steps that depend on the "build image" step, there is no way to determine if the dependency is stale or not.

If there was a field that stored the latest "build" time, that time could be compared against the modified time of files in the context, to determine if the build step is stale.

Related to #4237 in that it's mutable metadata that would not be sent to the registry. It would stay local to the daemon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/distributionImage Distributionkind/featureFunctionality or other elements that the project doesn't currently have. Features are new and shiny

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions