Help us understand the problem. What is going on with this article?

Docker image 一覧を容量順でソートする

More than 1 year has passed since last update.

docker imagesdocker image ls の出力をイメージサイズ順で並び替える方法です。

docker images --format "table {{.Size}}\t{{.Repository}}:{{.Tag}}\t{{.ID}}" | sed -e '1d' | sort -h -r


1.83GB              codelibs/fess:13.2                             eb10fdc61ad9
814MB               golang:1.12.7-buster                           be63d15101cb
757MB               golang:1.11.10                                 69a024a6ecf5
350MB               golang:1.12.5-alpine                           c7330979841b
102MB               ubuntu:18.04                                   d131e0fa2585
87MB                python:3.7-alpine3.9                           cd2b35632442
79.1MB              python:3.6-alpine3.9                           f5522c1c3739
71MB                node:10.15.3-alpine                            d7c77d094be1
69.2MB              debian:10-slim                                 83ed3c583403
55.3MB              debian:9-slim                                  92d2f0789514
5.53MB              alpine:3.9                                     055936d39205

sort -h (--human-numeric-sort) により GB, MB 表記のままでもソートできます。

Hugo ʕ◔ϖ◔ʔ や GitHub Actions について書いています。こっち に引っ越しましたので、今後 Qiita への新規投稿はしませんが記事のメンテはします。
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away