码头图像的sha256代码是什么? [英] What´s the sha256 code of a docker image?

查看:163
本文介绍了码头图像的sha256代码是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用他们的sha256代码来绘制centos,tomcat,...的图像,如



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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆