diff文件夹属于哪个容器或映像

diff文件夹属于哪个容器或映像

本文介绍了查找docker AUFS diff文件夹属于哪个容器或映像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道如何找到AUFS差异文件夹属于哪个docker容器,图像或卷吗?

Does anyone knows how to find to which docker container, image or volume an AUFS diff folder belongs?

我有一个这样的旧文件

/var/lib/docker/aufs/diff/d4f388f19d7b4e8e9eef2a4ae5630f87d59180263482fbc63dbe7d31b6c0fc5b/usr/lib/gcc/x86_64-linux-gnu/6/cc1

没有容器,卷或图像的ID为 d4f388f19d7b

There's no container, volume or image with this ID d4f388f19d7b

我试图找到它使用ID d4f388f19d7b 来检查每个容器,体积和图像,但没有运气

I tried to find it inspecting each container, volume and image using the ID d4f388f19d7b but no luck

for $(docker ps -q)中的c;码头工人检查$ c |grep d4f388f19d7b;完成
空的响应

对于$(docker images -q)中的i;码头工人图像检查$ i |grep d4f388f19d7b;完成
空的响应

for v in $(泊坞卷ls -q);码头工人卷检查$ v |grep d4f388f19d7b;完成
空的响应

是否有一种简单的方法来识别哪个Docker容器/卷/映像拥有此文件? lsof 显示该文件未被使用,因为它是3个月前最后一次访问的旧文件.

Is there an easy way to identify which docker container/volume/image owns this file? lsof shows that the file is not in use as it's a legacy file last time accessed was 3 months ago.

我没主意

推荐答案

我找到了将diff文件夹映射到容器的方法

I found the way to map a diff folder to a container

grep DIFF_FOLDER_ID/var/lib/docker/image/aufs/layerdb/mounts/*/mount-id

它将为您提供容器ID,如果您得到空输出,则表示它是孤立的或属于Docker映像

it will give you the container ID, if you get empty output it means is orphaned or it belongs to a docker image

这篇关于查找docker AUFS diff文件夹属于哪个容器或映像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 16:19