kwk / docker-registry-frontend

Browse and modify your Docker registry in a browser.
https://registry.hub.docker.com/u/konradkleine/docker-registry-frontend/
MIT License
1.68k stars 616 forks source link

Ability to sort images by creation date #153

Closed HaraldNordgren closed 3 months ago

HaraldNordgren commented 8 years ago

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

ochanism commented 7 years ago

I also really really want this feature.

okbrown commented 7 years ago

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

cloudartist commented 7 years ago

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

Southclaws commented 7 years ago

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!

binhex commented 7 years ago

+1

pramodhkp commented 6 years ago

+1

MatrixManAtYrService commented 6 years ago

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.

gorillamoe commented 6 years ago

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

gorillamoe commented 6 years ago

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