wagoodman / dive

A tool for exploring each layer in a docker image
MIT License
46.69k stars 1.78k forks source link

[FEATURE REQUEST] - Sort by Size in Current Layer Contents #341

Open ondrovic opened 3 years ago

ondrovic commented 3 years ago

Would be nice to sort asc / desc based on size in the current layer contents

whyman commented 3 years ago

Yes, this would be amazing for easily finding the worst offenders!

dragonfax commented 2 years ago

Definitely would love this. Needed it today.

iiian commented 1 year ago

☝️ Implemented

Unfortunately, it's been almost a year since this codebase has had any merge activity on it, and I suspect it may be essentially "done" at this point. If anybody wants this feature, you can grab it from https://github.com/iiian/dive, until we hear otherwise. I'll add some build instructions to the readme, but it's incredibly simple, I was really excited when the thing just built, first-try, with literally zero fuss.

git clone git@github.com:iiian/dive.git
cd dive
make all
# your output will be in ./dist/dive_<your-target-triple>/dive
# for example, ./dist/dive_linux_amd64/dive

Then just grab it and toss it in your usr/bin or wherever.

Happy new year! 🥂🐳🤿

evandrocoan commented 1 year ago

Thanks @iiian , I was having trouble cloning it with ssh, but it worked with git clone https://github.com/iiian/dive

I also had to install go with: https://www.digitalocean.com/community/tutorials/how-to-install-go-on-ubuntu-20-04

  1. curl -OL https://golang.org/dl/go1.16.7.linux-amd64.tar.gz
  2. sudo tar -C /usr/local -xvf go1.16.7.linux-amd64.tar.gz
  3. export PATH=$PATH:/usr/local/go/bin

Adds a default hotkey of ctrl+o to flip between A-Z sort order and numerical sort-by-size-desc on the right-side pane.

I just need to focus with tab key and it works awesome: image

jumarko commented 12 months ago

@wagoodman is there any interest in incorporating this feature into the main repo?

iiian commented 12 months ago

@jumarko , I am pretty sure this has been merged into the main repo -- I have version 0.11.0 installed via homebrew & ^O toggles sort.

We might be able to close this PR

jumarko commented 12 months ago

^O toggles sort.

@iiian that's nice, I didn't know that. It seems it's not documented, though - it would be nice to add that to the README.