docker-registry-frontend icon indicating copy to clipboard operation
docker-registry-frontend copied to clipboard

Ability to sort images by creation date

Open HaraldNordgren opened this issue 8 years ago • 9 comments

In the list of images under a repository, I want to be able to sort images based on Creation date or Tag.

HaraldNordgren avatar Sep 15 '16 06:09 HaraldNordgren

I also really really want this feature.

ochanism avatar Jan 02 '17 08:01 ochanism

wow! this feature was not considered in the redesign? very poor!

okbrown avatar Jun 07 '17 10:06 okbrown

I strongly agree - it would be very nice if we can get this working!

cloudartist avatar Jun 07 '17 11:06 cloudartist

This is my number 1 hatred of Docker hub and what triggered me to go find an alternative, I'd love to see this implemented!

The issue here is the same as the Kubernetes dashboard sorting issue: the API does not support sorting (in fact it doesn't return anything other than an array of strings!) https://docs.docker.com/registry/spec/api/#listing-image-tags, https://github.com/kwk/docker-registry-frontend/blob/3ad864b388a24d5bef896b08593f8dfb3acf1357/app/services/registry-services.js#L105

The details (such as Created date) are then filled out in https://github.com/kwk/docker-registry-frontend/blob/3ad864b388a24d5bef896b08593f8dfb3acf1357/app/services/registry-services.js#L146

So the sorting must happen after these two bits of code have run before rendering.

Unfortunately I have no idea how to navigate Angular projects! But hopefully someone more vested in Angular/JS can tackle this one!

Southclaws avatar Jul 28 '17 12:07 Southclaws

+1

binhex avatar Nov 02 '17 11:11 binhex

+1

pramodhkp avatar Dec 08 '17 14:12 pramodhkp

This is slow, and ugly, and probably highlights some glaring deficiencies in my understanding of bash. But it does work:

docker_images_date() {
    docker images | head -n 1
    sorted_images=$(echo $(for id in $(docker images -aq) ; do
              docker inspect -f "{{.Created}}" $id
              echo ,$id                                              
          done) | sed 's/ ,/_/g;s/ /\n/g' | sort -r | sed 's/^.*_//')
    for image in $sorted_images ; do
        docker images | grep $image
    done
}

You can put that in your .bashrc and then do:

docker_images_date | grep myreponame

And (provided you've pulled them) you'll see your images listed in reverse creation order.

MatrixManAtYrService avatar May 06 '18 02:05 MatrixManAtYrService

You might want to take a look at this release: https://github.com/superevilmegaco/docker-registry-frontend/releases/tag/v3.0.0

gorillamoe avatar Jul 02 '18 20:07 gorillamoe

The newest release lets you sort by every column: https://github.com/superevilmegaco/docker-registry-frontend/releases/tag/v4.0.0

gorillamoe avatar Jul 04 '18 20:07 gorillamoe