Sort APIImages by most recent creation date.#1396
Conversation
|
Hi, I think the the sort should be in the client as I think it's a display tweak |
|
I agree that this could be an option, but I don't see why it should be in the client. Moving the logic there forces everybody that writes a library to implement their own sorting. |
|
For the same reason we move all At least it's my opinion, @creack @crosbymichael |
|
My vote would be to keep display logic on the client. |
|
+1 on @vieux regarding |
|
Yeah, that's the point of this change. I'd like to have the server to send the list of images in a consistent way. Right now you get a list according to how docker reads the graph, either it takes the heads or the map. The result is not always in the same order, which is kind of a pain to use. I think returning always a list of images sorted by creation is consistent and it makes sense in a lot of cases. It's also easy to scan and understand by the human brain. I don't mind to move the sorting to the client, I only need to change a couple of lines, but I'd really like to get a consistent list of ordered images from the server. |
|
Ok, that sounds totally reasonable to me, sry. |
|
When an image is tagged 2 times, the 2 tags will have the same creation date, therefor, the sort will still be random on these. If the point if to be consistent, maybe we should add a name sort for images with the same creation data ?
|
|
Indeed, we also need to order alphabetically |
|
@calavera ping |
|
Sorry for the delay in my replays, it was a crazy couple of weeks. I agree that it should sort by creation date and name. |
This establishes a strict alphabetical order for tags with the same creation date.
|
LGTM |
|
LGTM |
Sort APIImages by most recent creation date.
This makes the command
docker imagesto return the most recent created images first.Fixes #985.