问题描述
我想使用它们的sha256代码提取centos,tomcat,...的图像,例如
I´d like to pull the images of centos, tomcat, ... using their sha256 code, like in
docker pull myimage @ sha256:0ecb2ad60
但我找不到任何地方都可以使用的sha256代码。
but I can´t find the sha256-code to use anywhere.
我检查了dockerhub存储库中是否有sha256代码的任何提示,但找不到任何提示。我通过标签
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
并使用 docker inspect
检查图像,以查看元数据中是否有sha256代码,但是是没有(添加图像的sha256代码可能会更改sha256代码)。
and checked the image with docker 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).
我是否必须自己计算图像的sha256代码并使用该代码?
Do I have to compute the sha256 code of an image myself and use that?
推荐答案
刚刚看到它:
当我拉一张图片时, sha256代码显示在输出的底部(摘要:sha ....):
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 way you can be sure that the image is not changed and can be safely used for production.
这篇关于在哪里可以找到码头工人镜像的sha256代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!