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.
When an image is built for the first time, the
Createdtime 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 theCreatedtime 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
maketo 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.