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
Fix issue #3375 - Return most recent image from the cache #3417
Conversation
Great big +1s! Nicely done. /cc @crosbymichael @creack |
ping @crosbymichael @creack - this one is super small ;) |
@Sjord Can you add a test to verify that the correct image is returned when more than one match? |
@Sjord Can you rebase? Build used to take a random image for cache (because golang maps are unordered), now it is sorted, but alphabetically, it makes the build consistent, but your solution of sorting by date is even better :) |
I merged master into my branch, without commit 1d4b7d8. |
I don't really know how to write a test for this. |
@Sjord It looks like you did a merge instead of a rebase. Also you have a messy commit history ( a revert ). Can you fix and squash your commits into one please? |
You also have a doc change that has nothing to do with the code changes. You should remove that from this PR and open a new PR for the doc spelling error. |
That spelling change came in with the merge, I don't know what went wrong. I now rebased and force-pushed to this branch, so now only my changes are visible. |
Thanks |
We just started to require contributors to sign the commits following these rules: https://github.com/dotcloud/docker/blob/master/CONTRIBUTING.md#sign-your-work Each commit in your PR must be signed in the following format: Please rebase and sign each commit. |
This reverts commit 1d4b7d8. Docker-DCO-1.0-Signed-off-by: Sjoerd Langkemper <sjoerd@byte.nl> (github: Sjord)
ImageGetCached searches for an image from the cache. Instead of returning the first image it finds, it should return the most recently created image. When a build with --no-cache then adds a new image with the same parameters, it is used instead of the old, existing image. Docker-DCO-1.0-Signed-off-by: Sjoerd Langkemper <sjoerd@byte.nl> (github: Sjord)
Ok, I added a signature to each commit message. |
LGTM ping @creack |
LGTM |
Fix issue #3375 - Return most recent image from the cache
ImageGetCached searches for an image from the cache. Instead of returning the
first image it finds, it should return the most recently created image. When a
build with --no-cache then adds a new image with the same parameters, it is
used instead of the old, existing image.