manage docker images
- don’t want to run
$ docker image prune -a
because there are ad hoc images that are used occasionally.
# sort by registry name
$ docker image ls | sort
# sort by tags & delete old versions by registry name
$ docker image ls --format="{{.Tag}}\t{{.ID}}\t{{.Repository}}" |
sort |
grep <name> |
cut -f 2 |
tr '\n' ' ' |
sed 's/ $/\n/'
All references except the last one can be deleted.