docker volume ls显示了我没有创建的大量卷

时间:2017-08-30 18:44:48

标签: docker amazon-ec2

我有一个EC2实例,我不时地使用它来做一些与docker相关的东西。但是,我从未明确创建卷。当我在其上docker volume ls时,它显示了很多码头工作量:

local               06006388e3da6b14f1960dae0a38a378e5cba64f618abf545f1de6038ad47e6b
local               112b6e2a6caa585630aa77c86f523673ff98c915f2ad067d33738cc1fa246359
local               17f69011605fcf604dc094a306a4bd38ccb1fe5794be355ab30b2f26e6feae12
local               187c654445b5910ecff878134868f640164960f34c650d474271f68cb0b6cc49
local               18b1996f10c5681cfa61f7d4792c9b52758d9dfb7be32f6bd131cf94ca32b47b
local               1c20b4a745b846545e7d46217f460c36acc3183471dfaf47df847f4158c33a28
local               20ee8b8664381f4d352cedd45942f205619bf4471409d571a673b75e9d6ffe1e
local               26fa7d08eea01b467ff07a5436fc9176b98cae86e56ec146671871f613706b55
local               26fe27a677ac643731ca93f63e70154d35d54aca5fa8814bffaf0228b2cd833f
local               306bab5cb25b515f3f6543dcec97dc2ee5613a7678b0f724a656aa0ab4047b66
local               3a37182249c7cb5b309c754919399743a30e927c6a6273416b8ea5f0a6342235
local               3a9adadd5d3d442a44209fb55916211563bedd8131893711c14b618bdacef159
local               3d6ac42e20a2ce078e18c063870f0f637893864274fd03585e8a900392bc4d35
local               41b58ae98eb7cc2b0635680665f4d22bbbebecbeb3adaf74b1acfa1811e9e05c
local               46725d41ba5cd8257f41b4c3194bad3aa835ce9aa543de2d07ec9d0150fdbf0b
local               4e3f9fb9dbfa9f3e29ec0145508c425c3e5e55293765ff01815977b60985521f
local               5a05ee6ec4e1735c308052ff331e4619cd97408c702bdc5493415db72621af3a
local               5bbff82b408d6251ff65f980067fde349a5501c08b4bd44dcaf0adaef6664428
local               5fd4c3f132ff0c1018fea48a903e4237f7824a931c1f8f2a11260ccf71329b12
local               65835e24924099292595214f901f8e7dc2fe32f62e91ab027f878dc932699535
local               6a8708355736b9073c6572712419a66d77d525e1056dd322c1b0ef95efa0476b
local               6fcbb24ba467e06fbea144737481c27af5332e2b7613113e09c024501073c85e
local               78fbbcc9e9b5f974b9d78a4b4d272d624a9e46aa7b8c653de7c1d87527e83624
local               794a48bd1f7ef858c1371d97a51b635c79efa7db57ad1c46292ca6261d27b007
local               8690db63a8c3da6ca4f8bacd18b0254bfc81bc8bd6c64e0b79dcc23e161a5079
local               8fd01482fa1bbf4cc696ca19ff9d7331e51b7d6b9285e825cacf072507451f1e
local               937112ddd025c517fe537fe0a2a4125e3cf1257ec65f1615718371542d07cd72
local               9488323c76e1b246f9af438e2d0daf66b1ae7a4567170f40db4c4fd368deb232
local               98eebbb5beb4d57ee0eab3111ec767773b4a12e7f62b5e50102e4117edaed976
local               9e5a3af5fc16462204caacae55bfe7662b4600073b8e30079ee8eab69b952121
local               aa1aa7b1c99dd7095156050f6203963e8988738dc198d6595499abf9280d6603
local               ada09e5dac11c9231922f790c4c77210935cf3711f36bc5bbcb34f882938a276
local               ba83ca6b8edee97c323a40b1d882824685fbe8b0a526f13d3053910c37097027
local               c44a214182b52e4198e53e32e9f9730e28dbc51312b39d64c8cc6882542bef4a
local               c78fd32523ad0f70276800587fa032407b4c8be3ad95600857c5cc0058ca4315
local               caf21df19329d264191fa53316625c612ec2777198b8003142a310203dc4a970
local               cfa92e304031d240375611a38cbb201bdb5ba632bfbca9774c252ca97b24e272
local               d22aa5def4e5044e302792a425f5045856d0ed370cac520757a6170e710b034a
local               d463662acb0b772a3be7ff67c35e2b3a5e3efdb48eca471e56268be9faf9932b
local               d6c4f3f028de791c2601a8e445f5e65d9f4f746cf293015f606807934fedf073
local               d6f8c57718756c77429c59081e16736b1c2fa5df23c1e11c79078c8bb461183e
local               e1084c11a2b8a45250357f4708beff23196d6a0eae741165ecfd62e39e24d410
local               ea11fd0c23b93f297abee0fd32e6b4574779a330b1e40037a182b3e11ad33c6d
local               ef5b35c246581d37626eb333b4cc8038e18354ad123e155dced6d9eab0feb801
local               f0019398d14c0569a6086f7d196c9949ad95fe4b1f48905f9ae4ec461d619864
local               f50f4551175a681cf2f8490c94592d1cde6f1dc7e6ff6e3ea5152269f44aef2a
local               f5802124aea30e2c531e3f8c4e18075acb3bc8ef0a6dc40aba277eb579f90124
local               f9b5f833e9d9c97ae22254dcb9434347d961febab44c8661b026daff4eb87153
local               fd757d33c33b9a2f342c9c1d0bfcb73337b7c17b542df472e74a8e15df45e753
  • 我不知道创造了什么
  • 他们是系统卷吗?
  • 它们用于什么?
  • 删除后会发生什么?

2 个答案:

答案 0 :(得分:1)

当图像具有VOLUME声明时,如果您不使用-v标志映射卷,则docker会自动分配命名卷。即使容器被删除,卷仍然存在。这可以解释您在主机中的音量。

我想你可以删除与任何容器无关的卷。

您可以在此处找到有关如何检查和删除未使用的卷https://github.com/chadoe/docker-cleanup-volumes/blob/master/README.md

的详细信息

答案 1 :(得分:0)

如果您不希望图像中的volume声明自动创建docker volume,那么您也可以首先删除卷声明。这有点棘手,但它确实有效 - 请参阅docker-copyedit