如何确定 Docker 下载的镜像对应的目录

2018-12-18 14:17:21 +08:00
 DearTanker

在黑群晖里面折腾 Docker 遇到一个比较棘手的问题,Google 了几个月没找到方法。

下载了几个 image 镜像:

root@HP-Gen8-DSM:~# docker images
3REPOSITORY                    TAG                 IMAGE ID            CREATED             SIZE
atlassian/confluence-server   6.13.0              7b1705b3ff8f        2 weeks ago         981MB
dpage/pgadmin4                3.6                 885166b71c10        3 weeks ago         262MB
postgres                      9.6.9               106bdfb062df        4 months ago        235MB

但是不知道对应镜像目录是哪个:

root@HP-Gen8-DSM:/volume1/@docker/btrfs/subvolumes# ll
total 0
drwx------ 1 root root 6430 Dec 17 20:17 .
drwx------ 1 root root   20 Dec 17 14:27 ..
drwxr-xr-x 1 root root  184 Dec 17 18:18 0177d981c89a9749c2723da2b23c798b49a8aa957f57ede4ab0d262c086d0cd6
drwxr-xr-x 1 root root  170 Dec 17 19:24 0819c021ac86443a7c23530ca8a3c9506a62dad6a81c5d2907649adc8bd0f6f3
drwxr-xr-x 1 root root  170 Dec 17 19:24 0819c021ac86443a7c23530ca8a3c9506a62dad6a81c5d2907649adc8bd0f6f3-init
drwxr-xr-x 1 root root  124 Dec 17 18:19 08329ceddaa61aabcf84cfbe892b5f13fab4cfcfbc9c8b77355ba05c050d8ddd
drwxr-xr-x 1 root root  108 Dec 17 18:19 0a10c5bb87be69ffb744fc3dbd4a876bb886d14100119bc3fa0422b96a9a0974
drwxr-xr-x 1 root root  132 Dec 17 18:18 0aa85aa90f65339fa122a63aae7c28d9dbe62829474b4188110500c855ff1d3f
drwxr-xr-x 1 root root  184 Dec 17 18:18 1cc56e0e088fc8a0a40f4006bc622e1c2edcde6fe09a33bfd9d896a766ac1da9
drwxr-xr-x 1 root root  108 Dec 17 18:19 2328a6636b1a0b955999fea881f29ed5546b0c22d82198da8f6f32702fcbd1e5
drwxr-xr-x 1 root root  108 Dec 17 18:19 2557e744b7f04ca112373459f9f2d1b0d0a60bce009948ee52533ab96f1e6b4e
drwxr-xr-x 1 root root  124 Dec 17 18:19 3191de7e4bae4ca1c7ba399b7c7ce1841afce9df0eaadb1bd11246a150a3bc0b
drwxr-xr-x 1 root root  132 Dec 17 18:15 3275e20a52b655413cde6868cce47c5b2efd82ae6115e38a42c03de7e9c26b8d
drwxr-xr-x 1 root root  132 Dec 17 18:15 33ed864d32cc848ceee12bcb072b27de12d2f6d3e830c6e447cb12f02376dfae
drwxr-xr-x 1 root root  124 Dec 17 18:19 396b7b1f3c551e8870b8bd0627c44187106c9755fc7a8637aa23d6b9694ff55b
drwxr-xr-x 1 root root  132 Dec 17 18:15 536f5f50d92f6729d0f9909b69e6080844ac57f7b29b35386e18ef631442534a
drwxr-xr-x 1 root root  108 Dec 17 18:19 53c71f045525ca35f849f5f1f43bee9dffc0d048fc8612b13571dd762b84b1c4
drwxr-xr-x 1 root root  184 Dec 17 18:18 5f279b09c8a3a836cf920d1b542001173841b9dd731b6285f61d823b7fc22c95
drwxr-xr-x 1 root root  108 Dec 17 18:19 632e988754fec38d40a864fbf961988e6cd2a70bded7d8db9a270d4dddaf827e
drwxr-xr-x 1 root root  132 Dec 17 18:15 6c9715a622c2984785a8af71b8c7d9a2dc14094d4b7027423a1247e9d0820256
drwxr-xr-x 1 root root  108 Dec 17 18:19 6f599819bc0890c39a8a93e890b5c1a82504feabd2bfa17ee3affd8ea98a21ab
drwxr-xr-x 1 root root  184 Dec 17 18:18 767d6c74de2be179f730ff040c7974a83554469cf43bb1ca38cd0b59ee0e456d
drwxr-xr-x 1 root root  158 Dec 17 18:16 7bf9e07cf56314b6040fed57320f6b258f0a4b4e77b4be3d23ace0f7ef3988d4
drwxr-xr-x 1 root root  124 Dec 17 18:19 80e5e45b4318224cf527e1b9937e4485c58ac0ff2bd9dbf84e97cb561809b12a
drwxr-xr-x 1 root root  132 Dec 17 18:18 82511c81640e1129dca589432173d1b9a13d2f31aad6419622aaba0db6f7273c
drwxr-xr-x 1 root root  158 Dec 17 18:15 8573f1b901ac4984a430398275876b667c271e82572c8f6f41f3a31ce012cedf
drwxr-xr-x 1 root root  132 Dec 17 18:18 8da80ee80af713be3007515384073776acad7dd3580627ee61aed96989dacfd4
drwxr-xr-x 1 root root  132 Dec 17 18:18 a7c9bb64e258f62ced431a2c648df40c475f4cd839189a19f21fb61b0d21b3e6
drwxr-xr-x 1 root root  132 Dec 17 18:15 aaa7ef3c77e09c89776ccbf61019660fbbdd01183489b24b89b95503e06dc1f5
drwxr-xr-x 1 root root  108 Dec 17 18:19 ad5a0ee34c849bde85ea518ea9c487e6a2d1fcd3694c77ea5afdadb593650616
drwxr-xr-x 1 root root  124 Dec 17 18:19 afa47768b6f54d4fac2214a86f928609f8cf8fac1ee904a17c80daa54047d98f
drwxr-xr-x 1 root root  132 Dec 17 18:15 b00f1c4c4d5143b7a57043d3a1e3ae76b374bedb564e3c2bf761360f83abe961
drwxr-xr-x 1 root root  184 Dec 17 18:18 b0d329b4f38a524f4816a51ccd4214f484c829984acd6df96a52aced60c825b1
drwxr-xr-x 1 root root  124 Dec 17 18:19 b3a5eed179c10ca31e7b9cd450fd2bdcc19b250f10eaadf6b8f3d4e86e72e64a
drwxr-xr-x 1 root root  184 Dec 17 18:18 be0c6e6bc457624601898ba4a9ca7526c3a09727471370c6d7d1767b84c6fa14
drwxr-xr-x 1 root root  184 Dec 17 18:18 c3a8a4ed911ac251f316c62c43aea2439601dfc405cbf8ce5e9384a0d2980506
drwxr-xr-x 1 root root  224 Dec 17 18:18 ceb87bb0139f94cdfde3b368875fab2e8321f6d61fca468f7c50022ed6d32e57
drwxr-xr-x 1 root root  124 Dec 17 18:19 d074f013df36ebcebf09244d52ee6efde76880aea7f8ad3d6a8f7de4a515a94f
drwxr-xr-x 1 root root  244 Dec 17 19:23 d6faeada9ab6282809df310f152c3e9589a1ddb0166cbde07c5446c27e5945f4
drwxr-xr-x 1 root root  244 Dec 17 19:23 d6faeada9ab6282809df310f152c3e9589a1ddb0166cbde07c5446c27e5945f4-init
drwxr-xr-x 1 root root  124 Dec 17 18:19 d8b3b09628c9055d36277662fd1ea98170310d180304f4a02f2ae0b486623b0e
drwxr-xr-x 1 root root  124 Dec 17 18:19 d9dcb1b9c48fc9a70f371ba508dc76d4d0e664fd3cf53ebc26d981db8e044697
drwxr-xr-x 1 root root  132 Dec 17 18:15 da97952a5e2a77adf0fb34540a6509b5fbe7f98b02e060b40342fb7dd6ecb15e
drwxr-xr-x 1 root root  132 Dec 17 18:18 e6be116618a839f751c9a91275b37f68ee94175ec71ed76d9892332fd898fc3d
drwxr-xr-x 1 root root  132 Dec 17 18:15 e84657e39df5b998ba5389813c583d7ea617e34cb06364b15fcd306421c44292
drwxr-xr-x 1 root root  158 Dec 17 18:15 ea658bb2aa6f75cf7c484ad8e384a1da9cb04f4c2e6c9dbbef672bd52417c62e
drwxr-xr-x 1 root root  132 Dec 17 18:15 f3797551e573ed255bf373f9cf9d283adf431d807f5c87303a2789fe487540cf
drwxr-xr-x 1 root root  178 Dec 17 19:21 f592ff402f4dbf6ac0f70bbb6167d089ffdc908a67f471acbfb99a592be4bbae
drwxr-xr-x 1 root root  178 Dec 17 19:21 f592ff402f4dbf6ac0f70bbb6167d089ffdc908a67f471acbfb99a592be4bbae-init
drwxr-xr-x 1 root root  124 Dec 17 18:19 f832bc4d54209fe5e3ff50cdbe6644ef98a8587fbbc971ef8d310c6bd111fcb2
drwxr-xr-x 1 root root  132 Dec 17 18:18 fcc271a7ea6ba4dd3ea35a2134738b8938f23f9d7cf39d97ed3e9a64a3f1d57d
drwxr-xr-x 1 root root  150 Dec 17 18:19 fd5c40d5c4cc7a0bd1e14cd7505e59b2014fcc63e20074e85f725ed5342104a3

现在的办法是手动一个个去点击打开目录或者通过 df 查看目录占用大小来判断是不是想要的镜像。这也太蠢了吧。

另外,我只知道如果运行了某个镜像的容器,会生成一个同名 - init 的新映像目录。

希望有熟悉 Docker 的朋友可以告诉我确认镜像目录更好的办法。

10359 次点击
所在节点    Docker
23 条回复
shakespaces
2018-12-19 12:27:45 +08:00
@leopku 谢谢,成功了
shakespaces
2018-12-19 12:28:19 +08:00
@DearTanker 我之前试过没有用,现在用了 20 楼的方法就好了
maleclub
2018-12-27 19:54:36 +08:00
@shakespaces 同问题,已解决。chmod 777 目标目标文件夹即可。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/518607

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX