关于Docker的目录结构分析,以及docker pull文件的存放问题

一、可以肯定的是,Docker pull 肯定是包含download的过程,download是要指定目录的,或者默认,这里的Docker pull 就是默认的下载目录

1.1 /etc/docker 目录下

key.json内容如下文件
{
    "crv": "P-256",
    "d": "nh1mG3M1wrnBYBbt4EvKf4Ff4CkY9GrBQBMY1WtcpJI",
    "kid": "4KSA:PEIQ:I5SZ:O7VD:F3LC:RUUP:UFY4:CUPS:2SEF:FA7K:UW7C:57SL",
    "kty": "EC",
    "x": "W5jdmuJRZaKrO8t_Mld9MomA8QI0kuD3axg-Oq6VeHU",
    "y": "bBvIjlFFgFp-hE_Dl_NCuKScmsu90K4sEA9FLQOUVhY"
}

1.2 /var/lib/docker 目录下

1.3 /var/lib/docker/containers,这个目录,每每Docker run 一次,这里就会多一条记录

1.4 /var/lib/docker/containerd

1.5 /var/lib/docker/image/overlay2,这个目录比较重要,所有的docker pull **,都在这里存着

1.6 /var/lib/docker/image/overlay2/distribution,存的是

1.6.1 /var/lib/docker/image/overlay2/distribution/diffid-by-digest/sha256

1.6.2 /var/lib/docker/image/overlay2/distribution/v2metadata-by-diffid/sha256


这里两个都是Json格式的数据

[
{
"Digest": "sha256:ee153a04d6837058642958836062f20badf39f558be3e6c7c7773ef7d8301d90",
"SourceRepository": "docker.io/library/busybox",
"HMAC": ""
}
]
[
{
"Digest": "sha256:1b930d010525941c1d56ec53b97bd057a67ae1865eebf042686d2a2d18271ced",
"SourceRepository": "docker.io/library/hello-world",
"HMAC": ""
}
]

1.7 /var/lib/docker/image/overlay2/imagedb

1.7.1 /var/lib/docker/image/overlay2/imagedb/content/sha256

{
"architecture": "amd64",
"config": {},
"container": "d6bc4fd488f31e0e72c06b4f268e475ff54ca7c17bc3a867da366aa581576057",
"container_config": {},
"created": "2019-07-18T21:20:21.810680491Z",
"docker_version": "18.06.1-ce",
"history": [],
"os": "linux",
"rootfs": {}
}
{
"architecture": "amd64",
"config": {},
"container": "8e2caa5a514bb6d8b4f2a2553e9067498d261a0fd83a96aeaaf303943dff6ff9",
"container_config": {},
"created": "2019-01-01T01:29:27.650294696Z",
"docker_version": "18.06.1-ce",
"history": [],
"os": "linux",
"rootfs": {}
}

1.7.2 /var/lib/docker/image/overlay2/imagedb/metadata/sha256


这个目录下,为空

1.8 /var/lib/docker/image/overlay2/layerdb

1.9 repositories.json ,可以看出这里存的是docker pull 的文件

{
	"Repositories": {
		"busybox": {
			"busybox:latest": "sha256:db8ee88ad75f6bdc74663f4992a185e2722fa29573abcc1a19186cc5ec09dceb",
			"busybox@sha256:9f1003c480699be56815db0f8146ad2e22efea85129b5b5983d0e0fb52d9ab70": "sha256:db8ee88ad75f6bdc74663f4992a185e2722fa29573abcc1a19186cc5ec09dceb"
			},
	"hello-world": {
		"hello-world:latest": "sha256:fce289e99eb9bca977dae136fbe2a82b6b7d4c372474c9235adc1741675f587e",
		"hello-world@sha256:6540fc08ee6e6b7b63468dc3317e3303aae178cb8a45ed3123180328bcc1d20f": "sha256:fce289e99eb9bca977dae136fbe2a82b6b7d4c372474c9235adc1741675f587e"
		}
	}
}

下一篇,Windows下如何构建Docker 项目

全部评论

相关推荐

狠赚笔第一人:学计算机自己不努力怪大环境?我大一就拿到了美团大厂的offer,好好看看自己有没有努力查看图片
点赞 评论 收藏
分享
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务