我在理解“ docker save XXX” tar文件和“ docker inspect XXX”命令之间的Docker层ID差异时遇到问题。
1)泊坞窗检查映像名称
2)docker save -o image.tar image_name tar -tvf image.tar
为什么两个命令中的图层ID不同?
输出1:
"RootFS": {
"Type": "layers",
"Layers": [
"sha256:63e1aa2bbccae06b6c7b4f9d214381e941ca1050adef9d7d7ef7ac78fce7b9d1",
"sha256:feb3b9e598153f23f6db9805b767ab1017a9ffb52e6ef9e4bf7873b5d751745d",
"sha256:f7111e33c9900370a59d568dcf960c6e149534bce4d87e23a9734eb9840acccf"
]
},
"Metadata": {
"LastTagTime": "2019-05-15T12:32:31.286070228+08:00"
}
输出2:
[root@node1 Dfile]# docker save -o suselzy2.tar suselzy2:1.0
[root@node1 Dfile]# tar -xvf suselzy2.tar
273ff03bcdcb92b450c9c2cee53a8641213616d3b4a192afc158daba28bf2263/
273ff03bcdcb92b450c9c2cee53a8641213616d3b4a192afc158daba28bf2263/VERSION
273ff03bcdcb92b450c9c2cee53a8641213616d3b4a192afc158daba28bf2263/json
273ff03bcdcb92b450c9c2cee53a8641213616d3b4a192afc158daba28bf2263/layer.tar
31cccc98ef2087beb3b50bacceb619a7092d0f37e74cd868272be16f33497904.json
91de7387a5d3b0e0e0c3dceeeb2fdc3ef948f9d06704c87f198c781d20391e94/
91de7387a5d3b0e0e0c3dceeeb2fdc3ef948f9d06704c87f198c781d20391e94/VERSION
91de7387a5d3b0e0e0c3dceeeb2fdc3ef948f9d06704c87f198c781d20391e94/json
91de7387a5d3b0e0e0c3dceeeb2fdc3ef948f9d06704c87f198c781d20391e94/layer.tar
fa621212eab4ec6bcb3cb73783b214704d69748a5be86af109cb6bd5fe614c62/
fa621212eab4ec6bcb3cb73783b214704d69748a5be86af109cb6bd5fe614c62/VERSION
fa621212eab4ec6bcb3cb73783b214704d69748a5be86af109cb6bd5fe614c62/json
fa621212eab4ec6bcb3cb73783b214704d69748a5be86af109cb6bd5fe614c62/layer.tar
manifest.json