码头图像的sha256代码是什么? [英] What´s the sha256 code of a docker image?
问题描述
docker pull myimage @ sha256:0ecb2ad60
但是我没有找到sha256代码在任何地方使用。
我检查了dockerhub存储库中有关sha256代码的任何提示,但找不到任何内容。我通过他们的标签下载图片
docker pull tomcat:7-jre8
/ pre>
,并检查图像,查看元数据中是否有sha256代码,但没有(添加图像的sha256代码可能会更改sha256代码)。
我必须自己计算一个图像的sha256代码吗?
解决方案刚刚看到:
sha256代码显示在输出底部(摘要:sha ....):
docker pull tomcat:7 -jre8
7-jre8:从library / tomcat中获取
902b87aaaec9:已经存在
9a61b6b1315e:已经存在
...
4dcef5c50d60:已经存在
摘要:sha256:c34ce3c1fcc0c7431e1392cc3abd0dfe2192ffea1898d5250f199d3ac8d8720f
状态:图像是tomcat的最新版本:7-jre8
这个沙发
sha256:c34ce3c1fcc0c7431e1392cc3abd0dfe2192ffea1898d5250f199d3ac8d8720f
可以使用
docker pull tomcat @ sha256:c34ce3c1fcc0c7431e1392cc3abd0dfe2192ffea1898d5250f199d3ac8d8720f
blockquote>
这样你就可以确保图像没有改变,可以安全地用于生产。
I´d like to pull the images of centos, tomcat, ... using their sha256 code, like in
docker pull myimage@sha256:0ecb2ad60
but I can´t find the sha256-code to use anywhere.
I checked the dockerhub repository for any hint of the sha256-code, but couldn´t find any. I downloaded the images by their tag
docker pull tomcat:7-jre8
and checked the image with inspect to see if theres a sha256 code in the metadata, but there is none (adding the sha256 code of the image would probably change the sha256 code).
Do I have to compute the sha256 code of an image myself and use that?
解决方案Just saw it:
When I pull an image, the sha256 code is diplayed at the bottom of the output (Digest: sha....):
docker pull tomcat:7-jre8 7-jre8: Pulling from library/tomcat 902b87aaaec9: Already exists 9a61b6b1315e: Already exists ... 4dcef5c50d60: Already exists Digest: sha256:c34ce3c1fcc0c7431e1392cc3abd0dfe2192ffea1898d5250f199d3ac8d8720f Status: Image is up to date for tomcat:7-jre8
This sha code
sha256:c34ce3c1fcc0c7431e1392cc3abd0dfe2192ffea1898d5250f199d3ac8d8720f
can be used to pull the image afterwards with
docker pull tomcat@sha256:c34ce3c1fcc0c7431e1392cc3abd0dfe2192ffea1898d5250f199d3ac8d8720f
This way you can be sure that the image is not changed and can be safely used for production.
这篇关于码头图像的sha256代码是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!