• images

    images

    • 使用方法
    1. docker images [OPTIONS] [REPOSITORY]
    2. List images
    3. -a, --all=false Show all images (default hides intermediate images)
    4. --digests=false Show digests
    5. -f, --filter=[] Filter output based on conditions provided
    6. --help=false Print usage
    7. --no-trunc=false Don't truncate output
    8. -q, --quiet=false Only show numeric IDs
    • 例子:

    查询本里存储的镜像

    1. $ sudo docker imgaes
    2. REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
    3. docker.io/ubuntu latest 63e3c10217b8 7 days ago 188.3 MB
    4. docker.google/etcd 2.1.1 2c319269dd15 8 days ago 23.32 MB
    5. docker.io/postgres latest 730d1d72bda2 2 weeks ago 265.3 MB
    6. centos latest 770327a1e9e7 2 weeks ago 418.9 MB

    将ID完整展现

    1. $ sudo docker images --no-trunc
    2. REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
    3. scratch1 latest dc869bfd3085af05a1a070c7409193e8be88de00ff4560e2e9af80ffa9d2041d 58 minutes ago 0 B
    4. registry.liugang/centos latest 770327a1e9e746cf8d4449a7134e87917982b33c7f5cea584d941350f5ead7ac 4 weeks ago 418.9 MB
    5. registry.liugang/busybox latest 8c2e06607696bd4afb3d03b687e361cc43cf8ec1a4a725bc96e39f05ba97dd55 4 months ago 2.43 MB
    6. docker.io/scratch latest 511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158 2 years ago 0 B

    使用该命令将展现没有tag的镜像

    1. $ sudo docker images --filter "dangling=true"
    2. REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
    3. <none> <none> b133995b6291 About an hour ago 0 B
    4. <none> <none> 6fae83243a01 About an hour ago 0 B
    5. <none> <none> 4c6412305cfa About an hour ago 0 B
    • 总结

    其中第一字段是image镜像的名称;TAG一般表示为版本号,也可以自己定义 ;IMAGE ID 表示镜像的唯一ID ,这也是判断两个镜像文件是否为同一个的判断标准。