dockerÏÂÔصÄÎļþÔÚÄÄ
docker ÈÝÆ÷ÄÚµÄÏÂÔØÎļþĬÈÏ´æ´¢ÔÚÈÝÆ÷µÄ×ÔÁ¦ÎļþϵͳÖУ¬ÏêϸλÖÃΪ /var/lib/docker/containers/[container_id]/[layer_id]/£¬ÆäÖÐ container_id ÊÇÈÝÆ÷ id£¬layer_id ÊÇÔ´¾µÏñ²ãµÄ id¡£¿ÉÒÔͨ¹ý docker inspect ÏÂÁî»ñÈ¡Ìض¨ÎļþµÄ׼ȷλÖá£
docker ÏÂÔØÎļþĬÈϴ洢λÖÃ
Docker ÈÝÆ÷ÄÚµÄÏÂÔØÎļþĬÈÏ´æ´¢ÔÚÈÝÆ÷µÄÎļþϵͳÖС£ÈÝÆ÷µÄÎļþϵͳÊÇÒ»¸ö×ÔÁ¦µÄ¡¢¸ôÀëµÄÐéÄâÎļþϵͳ£¬ÓëËÞÖ÷»úÎļþϵͳ²î±ð¡£
ÏêϸλÖãº
ÏÂÔصÄÎļþͨ³£´æ´¢ÔÚ /var/lib/docker/containers/[container_id]/[layer_id]/ Ŀ¼Ï£¬ÆäÖУº
container_id ÊÇÈÝÆ÷µÄ ID¡£
layer_id ÊǸÃÎļþµÄÔ´¾µÏñ²ãµÄ ID¡£
»ñÈ¡È·ÇÐλÖõÄÏÂÁ
¿ÉÒÔʹÓÃÒÔÏÂÏÂÁî»ñÈ¡Ìض¨ÎļþÔÚÈÝÆ÷ÎļþϵͳÖмòÖ±ÇÐλÖãº
docker inspect [container_id] | jq -r '.[0].GraphDriver.Data["/var/lib/docker/overlay2/[layer_id]/.diff"]'
µÇ¼ºó¸´ÖÆ
Ìæ»» [container_id] ºÍ [layer_id] ÒÔ»ñÈ¡ËùÐèÐÅÏ¢¡£
×¢ÖØ£º
Docker ÈÝÆ÷µÄĬÈÏ¾í²»»á´æ´¢ÔÚÈÝÆ÷µÄÎļþϵͳÖУ¬³ý·ÇÃ÷È·¹ÒÔØ»òʹÓà -v ±ê¼Ç¡£
ÈÝÆ÷µÄÎļþϵͳÔÚÈÝÆ÷ɾ³ýºó»á±»Ïú»Ù£¬Òò´ËÏÂÔصÄÎļþ²»»á±£±£´æËÞÖ÷»úÉÏ¡£
¿ÉÒÔʹÓà Docker ¾í»ò±¾»ú¹ÒÔØÀ´³¤ÆÚ´æ´¢ÈÝÆ÷ÖеÄÊý¾Ý¡£
ÒÔÉϾÍÊÇdockerÏÂÔصÄÎļþÔÚÄĵÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡