gpt4 book ai didi

linux - docker images 是列出整个图像的大小还是仅列出其中的一层?

转载 作者:行者123 更新时间:2023-12-02 18:13:06 24 4
gpt4 key购买 nike

user@localhost:~/docker-pyzmq$ sudo docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
alpinepyzmq_raw latest fd24a753f505 2 minutes ago 23.9MB
<none> <none> 3f763de0fb0b 7 minutes ago 23.9MB
alpinepyzmq_small latest c7a1f42d0bfd 14 minutes ago 94.8MB
alpinepyzmq latest 5be9ed0fcbcb 17 minutes ago 317MB
<none> <none> 97aa31fe216a 19 minutes ago 317MB
<none> <none> b167c481edc2 22 minutes ago 338MB
<none> <none> fe8504847607 29 minutes ago 304MB
<none> <none> 5b845a00f4d9 32 minutes ago 79.5MB
<none> <none> 2d6926b0c665 32 minutes ago 79.5MB
上面的输出是否意味着 alpinepyzmq_raw可以在计算机内运行,它的重量仅为 23.9mb?或者这个大小取决于其他层?如果是这样,我怎样才能弄清楚整个图像的大小?

最佳答案

Does the output above mean alpinepyzmq_raw can be run inside acomputer and it'll just weight 23.9mb?


图像大小和容器大小是两个不同的东西。
图片尺寸:
当你执行 docker image ls ,列大小不一定是图像的大小,因为这是当前图像+所有这些父图像的大小:

The SIZE is the cumulative space taken up by the image and all itsparent images. T23.9


而对于 Alpine 等没有父级的基本图像,您可以考虑图像大小。
在 docker 中,父图像不会合并到每个子图像中,而是存储在不同的层中以供共享。
要知道图像的实际尺寸(不包括父尺寸),请使用 docker history IMAGE .
容器尺寸:
容器大小并不严格等于图像大小。
此外,容器同时使用内存(ram)和磁盘。
To know disk occupation尺寸 :
docker system df 
这确实呼应了著名的 df linux command显示磁盘上的已用/可用空间。

关于linux - docker images 是列出整个图像的大小还是仅列出其中的一层?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62606280/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com