[root@rhels7-docker ~]# cat /var/lib/docker/image/devicemapper/repositories.json
{"Repositories":{"centos":{"centos:hadoop":"sha256:31deb9bb749d93473fdd7f01e0a2a5261d0540f75287cf42c9ae8da1b1a2b61a"},"daocloud.io/library/centos":{"daocloud.io/library/centos:centos7":"sha256:ea08fb8c4ba5494c7a77ba4381ba6fb8c871abd655c38c029a58ade8f5bb56fe"}}}python
[root@rhels7-docker ~]# cat /var/lib/docker/image/devicemapper/repositories.json | python -mjson.tool
{
"Repositories": {
"centos": {
"centos:hadoop": "sha256:31deb9bb749d93473fdd7f01e0a2a5261d0540f75287cf42c9ae8da1b1a2b61a"
},
"daocloud.io/library/centos": {
"daocloud.io/library/centos:centos7": "sha256:ea08fb8c4ba5494c7a77ba4381ba6fb8c871abd655c38c029a58ade8f5bb56fe"
}
}
}git
[root@rhels7-docker ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
centos hadoop 31deb9bb749d 3 hours ago 1.434 GB
daocloud.io/library/centos centos7 ea08fb8c4ba5 7 days ago 196.8 MB
[root@rhels7-docker ~]# du -h /var/lib/docker/devicemapper/devicemapper/*
1.6G /var/lib/docker/devicemapper/devicemapper/data
4.5M /var/lib/docker/devicemapper/devicemapper/metadatagithub
/var/lib/docker/devicemapper/devicemapper/data
/var/lib/docker/devicemapper/devicemapper/metadata
這兩個文件大小會隨着image pull、rmi操做而相應的增大、減少。
可初步斷定這兩個文件就是docker pull ${image}以後,image的layers真正存儲的地方。docker
從Docker鏡像構建機制瞭解到
實際存放images和container的地方就是/var/lib/docker/devicemapper/devicemapper目錄下的metadata和data兩個文件。(元數據)json
針對docker Version: 1.11.2centos
不一樣docker版本可能存在差別app