{"id":10297,"date":"2023-03-28T21:38:55","date_gmt":"2023-03-28T13:38:55","guid":{"rendered":"http:\/\/123.57.164.21\/?p=10297"},"modified":"2023-03-29T11:03:34","modified_gmt":"2023-03-29T03:03:34","slug":"openshift-4-%e6%a6%82%e5%bf%b5-openshift%e6%98%af%e5%a6%82%e4%bd%95%e9%80%9a%e8%bf%87imagestream%e8%ae%bf%e9%97%aeimage%e7%9a%84","status":"publish","type":"post","link":"https:\/\/92it.top\/?p=10297","title":{"rendered":"OpenShift 4 \u6982\u5ff5 &#8211; OpenShift\u662f\u5982\u4f55\u901a\u8fc7ImageStream\u8bbf\u95eeImage\u7684"},"content":{"rendered":"\n<p>\u6709\u5173ImageStream\u7684\u5165\u95e8\u64cd\u4f5c\u53ef\u53c2\u89c1\uff1a<br>\u300a <a href=\"https:\/\/blog.csdn.net\/weixin_43902588\/article\/details\/104138965\">OpenShift 4 Hands-on Lab (3) &#8211; \u7528ImageStream\u64cd\u4f5cImage<\/a>\u300b<\/p>\n\n\n\n<p><strong>ImageStream\u57fa\u672c\u6982\u5ff5<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>\u5bb9\u5668\u955c\u50cf\u5b58\u50a8\u5728\u955c\u50cf\u6ce8\u518c\u8868\u4e2d\uff08\u5982Docker Hub\u3001Quay.io\uff09\uff0c\u6211\u4eec\u53ef\u4ee5\u4ece\u90a3\u91cc\u624b\u52a8pull\u51fa\u6765\u5355\u72ec\u8fd0\u884c\uff0c\u4e5f\u53ef\u4ee5\u5728Kubernetes\u96c6\u7fa4\u4e2d\u8fd0\u884c\u3002Kubernetes\u6ca1\u6709\u5185\u7f6e\u7684\u955c\u50cf\u6ce8\u518c\u8868\uff0c\u7136\u800c\u8fd9\u5728\u4f01\u4e1a\u73af\u5883\u4e2d\u53c8\u662f\u901a\u5e38\u662f\u9700\u8981\u7684\u3002Red Hat OpenShift \u63d0\u4f9b\u4e86\u4e00\u4e2a\u5f00\u7bb1\u5373\u7528\u7684\u96c6\u6210\u6ce8\u518c\u8868\u6765\u586b\u8865\u8fd9\u4e00\u7a7a\u767d\uff0c\u5e76\u5f15\u5165\u4e86\u4e00\u4e2a\u540d\u4e3aImageStream\u7684\u65b0\u7684Kubernetes\u5bf9\u8c61\u8d44\u6e90\uff0c\u4ee5\u201cKubernetes-native\u65b9\u5f0f\u201d\u7ba1\u7406\u955c\u50cf\u3002<\/p>\n\n\n\n<p>ImageStream \u662f\u4e3a\u4e86\u652f\u6301\u4e0d\u540c\u7528\u9014\u800c\u8bbe\u8ba1\u7684\u3002\u4f46\u5728\u4e00\u5f00\u59cb\uff0c\u67d0\u4e9b\u5185\u5bb9\u53ef\u80fd\u4f1a\u8ba9\u4eba\u611f\u5230\u56f0\u60d1\u3002\u6280\u672f\u4e0a\u6765\u8bf4\uff0cImageStream\u53ea\u662f\u4e00\u4e2a\u5305\u542b\u5176\u5b83\u5b9e\u9645\u955c\u50cf\u5143\u6570\u636e\u7684Kubernetes\u5bf9\u8c61\u8d44\u6e90\uff0c\u5b83\u53ef\u4ee5\u6307\u5411OpenShift\u7ba1\u7406\u5185\u90e8\u7684\u955c\u50cf\uff08\u662f\u5728OpenShift\u96c6\u7fa4\u5185\u90e8Registry\u4e2d\u7684\u955c\u50cf\uff09\uff0cImageStream\u8fd8\u53ef\u4ee5\u6307\u5411\u5916\u90e8Registry\u4e2d\u7684\u955c\u50cf\u3002\u5bf9\u4e8e\u955c\u50cf\uff0cImageStream\u662f\u4e00\u4e2a\u989d\u5916\u7684\u62bd\u8c61\u5c42\uff0c\u5b83\u63d0\u4f9b\u4e86\u4e00\u4e9b\u989d\u5916\u7684\u529f\u80fd\uff08\u4f8b\u5982\u8f6e\u8be2\u66f4\u65b0\u3001\u7f13\u5b58\uff09\u3002\u7531\u4e8e ImageStream \u53ef\u4ee5\u6709\u4e24\u79cd\u4e0d\u540c\u7684\u884c\u4e3a\u65b9\u5f0f\uff0c\u5982\u679c\u6211\u4eec\u533a\u5206\u5b83\u4eec\u662f\u6307\u5411\u5185\u90e8\u955c\u50cf\u8fd8\u662f\u6307\u5411\u5916\u90e8\u955c\u50cf\uff0c\u5c31\u66f4\u5bb9\u6613\u7406\u89e3\u5b83\u4eec\u3002<\/p>\n\n\n\n<p>OpenShift\u5728\u751f\u6210ImageStream\u7684\u65f6\u5019\uff0c\u8fc7\u7a0b\u5927\u81f4\u5982\u4e0b\uff1a<\/p>\n\n\n\n<ul><li>OpenShift\u5c06\u63d0\u4f9b\u7684Image\u8bbf\u95ee\u5730\u5740\u5f53\u505aImageStreamTag\uff0c\u5e76\u901a\u8fc7\u8bbf\u95ee\u5730\u5740\u83b7\u5f97Image\u5176\u5b83\u5143\u6570\u636e\uff0c\u5176\u4e2d\u5305\u62ecImageStreamImage\u4fe1\u606f\u3002<\/li><li>OpenShift\u5c06ImageStreamTag\u548cImageStreamStream\u4f5c\u4e3a\u91cd\u8981\u5143\u6570\u636e\u4fdd\u5b58\u5728\u8fd9\u4e2aImage\u5bf9\u5e94\u7684ImageStream\u3002<\/li><\/ul>\n\n\n\n<ul><li>\u5728OpenShift\u4e2d\uff0cImageStreamImage\u662fImageStream\u4e2d\u7684\u4e00\u4e2a\u5177\u4f53\u7684\u955c\u50cf\u7248\u672c\u3002\u5b83\u662f\u4e00\u4e2a\u5bf9\u8c61\uff0c\u7528\u4e8e\u8868\u793a\u4e00\u4e2a\u7279\u5b9a\u7684\u5bb9\u5668\u955c\u50cf\uff0c\u5305\u62ec\u955c\u50cf\u540d\u79f0\u3001\u7248\u672c\u53f7\u3001\u955c\u50cf\u6807\u7b7e\u7b49\u4fe1\u606f\u3002\u6bcf\u4e2aImageStream\u90fd\u53ef\u4ee5\u5305\u542b\u591a\u4e2aImageStreamImage\u5bf9\u8c61\uff0c\u8868\u793a\u4e0d\u540c\u7684\u955c\u50cf\u7248\u672c\u3002<\/li><\/ul>\n\n\n\n<ul><li>\u5f53\u7528\u6237\u4f7f\u7528OpenShift\u90e8\u7f72\u5e94\u7528\u7a0b\u5e8f\u65f6\uff0c\u53ef\u4ee5\u901a\u8fc7\u5f15\u7528ImageStreamImage\u6765\u6307\u5b9a\u6240\u9700\u7684\u5bb9\u5668\u955c\u50cf\u7248\u672c\u3002\u8fd9\u6837\uff0c\u5373\u4f7f\u5728ImageStream\u4e2d\u66f4\u65b0\u4e86\u955c\u50cf\u7248\u672c\uff0c\u5e94\u7528\u7a0b\u5e8f\u4e5f\u53ef\u4ee5\u81ea\u52a8\u66f4\u65b0\u5230\u6700\u65b0\u7684\u7248\u672c\u3002<\/li><\/ul>\n\n\n\n<ul><li>\u5728OpenShift\u4e2d\uff0cImageStreamImage\u5bf9\u8c61\u662f\u81ea\u52a8\u521b\u5efa\u7684\u3002\u5f53\u7528\u6237\u63a8\u9001\u65b0\u7684\u955c\u50cf\u7248\u672c\u5230ImageStream\u65f6\uff0cOpenShift\u5c06\u521b\u5efa\u4e00\u4e2a\u65b0\u7684ImageStreamImage\u5bf9\u8c61\u6765\u8868\u793a\u8fd9\u4e2a\u955c\u50cf\u7248\u672c\u3002\u7528\u6237\u8fd8\u53ef\u4ee5\u4f7f\u7528OpenShift\u7684\u547d\u4ee4\u884c\u5de5\u5177\u6216Web\u754c\u9762\u6765\u67e5\u770b\u548c\u7ba1\u7406ImageStreamImage\u5bf9\u8c61\u3002<\/li><\/ul>\n\n\n\n<ul><li>\u603b\u4e4b\uff0cImageStreamImage\u662fOpenShift\u4e2d\u7528\u4e8e\u8868\u793a\u5bb9\u5668\u955c\u50cf\u7248\u672c\u7684\u4e00\u4e2a\u5bf9\u8c61\u3002\u5b83\u53ef\u4ee5\u5e2e\u52a9\u7528\u6237\u66f4\u52a0\u65b9\u4fbf\u548c\u7075\u6d3b\u5730\u7ba1\u7406\u5bb9\u5668\u955c\u50cf\uff0c\u5b9e\u73b0\u5bb9\u5668\u955c\u50cf\u7684\u7248\u672c\u63a7\u5236\u548c\u751f\u547d\u5468\u671f\u7ba1\u7406\u3002<\/li><\/ul>\n\n\n\n<p>OpenShift\u5e94\u7528\u5728\u4f7f\u7528ImageStream\u7684\u65f6\u5019\uff0c\u7f3a\u7701\u8fc7\u7a0b\u5927\u81f4\u5982\u4e0b\uff1a<\/p>\n\n\n\n<ul><li>OpenShift\u6839\u636e\u5e94\u7528\u63d0\u4f9b\u7684ImageStreamTag\u5728ImageStream\u4e2d\u627e\u5230\u5bf9\u5e94\u7684ImageStreamImage<\/li><li>OpenShift\u7136\u540e\u4f7f\u7528ImageStreamImage\u4ece\u8fdc\u7a0bRegistry\u4e0apull image\uff0c\u8fd9\u6837\u5c31\u53ef\u4ee5\u4f7f\u7528\u8be5Image\u4e86<\/li><\/ul>\n\n\n\n<p>\u4ee5\u4e0a\u662f\u7f3a\u7701\u751f\u6210ImageStream\u548c\u901a\u8fc7ImageStream\u4f7f\u7528Image\u7684\u8fc7\u7a0b\u3002\u9664\u6b64\u4ee5\u5916\u53ef\u4ee5\u5b9a\u5236ImageStream\u7684\u914d\u7f6e\uff0c\u53ef\u4ee5\u5b9e\u73b0\u4ee5\u4e0b\u5b9a\u5236\u8fc7\u7a0b\uff1a<\/p>\n\n\n\n<ul><li>OpenShift\u6bcf\u6b21\u4f7f\u7528\u7684Image\u7684\u65f6\u5019\u4e0d\u4f7f\u7528\u672c\u5730ImageStream\u4e2d\u7684ImageStreamImage\uff0c\u800c\u662f\u6bcf\u6b21\u90fd\u7528ImageStreamTag\u4ece\u5916\u90e8\u83b7\u53d6\u4e00\u6b21ImageStreamImage\uff0c\u7136\u540e\u518d\u6839\u636e\u83b7\u53d6\u5230\u7684ImageStreamImage\u6765pull image\u3002<\/li><li>OpenShift\u5728\u4f7f\u7528ImageStreamImage\u83b7\u53d6image\u7684\u65f6\u5019\uff0c\u7f3a\u7701\u6bcf\u6b21\u90fd\u4ece\u5916\u90e8pull image\uff0c\u4f46\u4e5f\u53ef\u4ee5\u9009\u62e9\u4f7f\u7528\u5df2\u7ecfpull\u5230\u672c\u5730\u7684Image\u3002<\/li><\/ul>\n\n\n\n<p><strong>\u6765\u81eaChatGPT\u7684\u8bf4\u660e<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2023\/03\/image-352-1024x726.png\" alt=\"\" class=\"wp-image-10325\" width=\"578\" height=\"409\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-352-1024x726.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-352-300x213.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-352-768x544.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-352-1536x1089.png 1536w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-352-830x588.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-352-230x163.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-352-350x248.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-352-480x340.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-352.png 1538w\" sizes=\"(max-width: 578px) 100vw, 578px\" \/><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2023\/03\/image-353-1024x1009.png\" alt=\"\" class=\"wp-image-10326\" width=\"582\" height=\"573\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-353-1024x1009.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-353-300x296.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-353-768x757.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-353-830x818.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-353-230x227.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-353-350x345.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-353-480x473.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-353.png 1260w\" sizes=\"(max-width: 582px) 100vw, 582px\" \/><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2023\/03\/image-354-1024x894.png\" alt=\"\" class=\"wp-image-10328\" width=\"530\" height=\"462\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-354-1024x894.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-354-300x262.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-354-768x671.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-354-830x725.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-354-230x201.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-354-350x306.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-354-480x419.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-354.png 1214w\" sizes=\"(max-width: 530px) 100vw, 530px\" \/><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2023\/03\/image-355-1024x506.png\" alt=\"\" class=\"wp-image-10330\" width=\"540\" height=\"267\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-355-1024x506.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-355-300x148.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-355-768x379.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-355-830x410.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-355-230x114.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-355-350x173.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-355-480x237.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-355.png 1190w\" sizes=\"(max-width: 540px) 100vw, 540px\" \/><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2023\/03\/image-356-923x1024.png\" alt=\"\" class=\"wp-image-10332\" width=\"542\" height=\"600\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-356-923x1024.png 923w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-356-270x300.png 270w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-356-768x852.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-356-830x921.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-356-230x255.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-356-350x388.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-356-480x532.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-356.png 1210w\" sizes=\"(max-width: 542px) 100vw, 542px\" \/><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2023\/03\/image-357-782x1024.png\" alt=\"\" class=\"wp-image-10333\" width=\"590\" height=\"773\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-357-782x1024.png 782w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-357-229x300.png 229w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-357-768x1006.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-357-230x301.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-357-350x459.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-357-480x629.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-357.png 806w\" sizes=\"(max-width: 590px) 100vw, 590px\" \/><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2023\/03\/image-358.png\" alt=\"\" class=\"wp-image-10335\" width=\"588\" height=\"214\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-358.png 726w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-358-300x109.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-358-230x84.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-358-350x127.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-358-480x175.png 480w\" sizes=\"(max-width: 588px) 100vw, 588px\" \/><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2023\/03\/image-359-902x1024.png\" alt=\"\" class=\"wp-image-10337\" width=\"593\" height=\"672\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-359-902x1024.png 902w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-359-264x300.png 264w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-359-768x872.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-359-830x942.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-359-230x261.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-359-350x397.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-359-480x545.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-359.png 1200w\" sizes=\"(max-width: 593px) 100vw, 593px\" \/><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2023\/03\/image-360-752x1024.png\" alt=\"\" class=\"wp-image-10340\" width=\"549\" height=\"748\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-360-752x1024.png 752w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-360-220x300.png 220w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-360-768x1046.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-360-830x1131.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-360-230x313.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-360-350x477.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-360-480x654.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-360.png 1048w\" sizes=\"(max-width: 549px) 100vw, 549px\" \/><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2023\/03\/image-361-1024x703.png\" alt=\"\" class=\"wp-image-10342\" width=\"552\" height=\"378\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-361-1024x703.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-361-300x206.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-361-830x570.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-361-230x158.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-361-350x240.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-361-480x330.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-361.png 1054w\" sizes=\"(max-width: 552px) 100vw, 552px\" \/><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2023\/03\/image-362-1024x949.png\" alt=\"\" class=\"wp-image-10344\" width=\"561\" height=\"520\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-362-1024x949.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-362-300x278.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-362-768x712.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-362-830x769.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-362-230x213.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-362-350x324.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-362-480x445.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-362.png 1034w\" sizes=\"(max-width: 561px) 100vw, 561px\" \/><\/figure><\/div>\n\n\n\n<p><strong>Internal Image \u548c Internal Registry<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>\u9996\u5148\uff0c\u4e0b\u9762\u662f\u5173\u4e8e\u5b58\u50a8\u5728Internal Registry\u4e2d\u7684Image\u7684\u4e00\u4e9b\u6ce8\u610f\u4e8b\u9879\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2023\/03\/image-342-1024x676.png\" alt=\"\" class=\"wp-image-10299\" width=\"557\" height=\"367\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-342-1024x676.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-342-300x198.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-342-768x507.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-342-830x548.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-342-230x152.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-342-350x231.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-342-480x317.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-342.png 1514w\" sizes=\"(max-width: 557px) 100vw, 557px\" \/><\/figure><\/div>\n\n\n\n<ul><li>\u5bf9\u4e8eOpenShift\u5185\u90e8Registry\u4e0a\u7684Image\uff0cImageStream\u548c\u5185\u90e8Registry\u662f\u7d27\u5bc6\u8026\u5408\u7684\u3002\u4f8b\u5982\uff0cis-project\u547d\u540d\u7a7a\u95f4\u4e2d\u540d\u4e3amyimage-internal\u7684ImageStream\u4f1a\u88ab\u6620\u5c04\u5230image-registry.openshift-image-registry.svc:5000\/is-project\/myimage-internal\u3002<\/li><li>\u5982\u679c\u6211\u4eec\u8fd0\u884c\u4e00\u4e2a\u65b0\u7684Build\uff0c\u5176\u4e2doutput\u6307\u5b9a\u7684\u662fImageStream\u7c7b\u578b\uff0c\u90a3\u4e48\u955c\u50cf\u5c06\u88ab\u5b58\u50a8\u5728OpenShift\u5185\u90e8\u6ce8\u518c\u8868\u4e2d\u3002\uff08\u3010\u5f15\u7528#1\u3011\u5982\u679cBuild\u7684output\u6307\u5b9a\u7684\u662fDockerImage\u7c7b\u578b\uff0c\u90a3\u4e48OpenShift\u4f1a\u4f7f\u7528push\u64cd\u4f5c\u5c06Image\u63a8\u9001\u5230\u6807\u51c6\u7684Docker Registry\uff0c\u7f3a\u7701\u662fDockerHub\uff09\u3002\u53e6\u5916\u540c\u7406\u9002\u7528\u4e8e\u6307\u5b9aBuilder Image\u7684\u6765\u6e90\u3002<\/li><li>\u5982\u679c\u6211\u4eec\u4f7f\u7528Push\u65b9\u6cd5\u624b\u52a8\u5411Internal Image Registry\u63a8\u9001\u4e00\u4e2aImage\uff0cOpenShift\u4f1a\u81ea\u52a8\u521b\u5efa\u4e00\u4e2a\u5339\u914d\u7684ImageStream\u5e76\u6307\u5411\u8fd9\u4e2aInternal Image Registry\u4e2d\u7684Image\u3002<\/li><li>\u5982\u679c\u6211\u4eec\u5220\u9664\u4e86ImageStream\uff0c\u5728OpenShift\u5185\u90e8\u7684Registry\u4e2d\u4fdd\u5b58\u7684Image\u5b58\u50a8\u4e5f\u4f1a\u88ab\u5220\u9664\u3002<\/li><li>\u4e3a\u4e86\u4fdd\u6301OpenShift\u5185\u90e8Registry\u7684\u4f7f\u7528\u7a7a\u95f4\uff0c\u4f60\u9700\u8981\u5b9a\u671f<a href=\"https:\/\/docs.openshift.com\/container-platform\/4.6\/applications\/pruning-objects.html#pruning-images_pruning-objects\">Prune Images<\/a>\u3002\u5728\u8fd9\u4e2a\u8fc7\u7a0b\u4e2d\uff0c\u90a3\u4e9b\u5728Build\u6216Deployment\u4e2d\u88ab\u4f7f\u7528\u5230\u7684\u5185\u90e8Image\u4f1a\u81ea\u52a8\u4fdd\u7559\u3002<\/li><\/ul>\n\n\n\n<p><strong>External Image \u548c External Registry<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>\u5728OpenShift\u4e4b\u5916\u7684External Registry\u4fdd\u5b58\u4e86\u5916\u90e8Image\u3002ImageStream\u548cExternal Registry\u3001\u4ee5\u53ca\u5176\u4e0a\u7684\u5916\u90e8Image\u7684\u5173\u7cfb\u5982\u4e0b\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2023\/03\/image-344-1024x648.png\" alt=\"\" class=\"wp-image-10301\" width=\"509\" height=\"321\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-344-1024x648.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-344-300x190.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-344-768x486.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-344-830x525.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-344-230x145.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-344-350x221.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-344-480x304.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-344.png 1524w\" sizes=\"(max-width: 509px) 100vw, 509px\" \/><\/figure><\/div>\n\n\n\n<ul><li>\u6211\u4eec\u53ef\u4ee5\u7528 oc import-image \u6216 oc tag \u547d\u4ee4\u521b\u5efa\u4e00\u4e2a\u6307\u5411\u5916\u90e8 Image \u7684 ImageStream\uff0c\u6216\u8005\u76f4\u63a5\u7528 yaml \u521b\u5efa\u4e00\u4e2a ImageStream\u3002<\/li><li>\u4e00\u4e2aImageStream\u4e2d\u7684\u6807\u7b7e\u53ef\u4ee5\u6307\u5411\u6765\u81ea\u5b8c\u5168\u4e0d\u540c\u7684Registry\u548cRepository\u7684Image\u3002\u901a\u8fc7\u8fd9\u79cd\u6709\u6548\u7684\u65b9\u6cd5\u53ef\u4ee5\u5c06\u76f8\u5173\u7684\u5916\u90e8Image\u5173\u8054\u8d77\u6765\uff0c\u800cImage\u53ef\u5b58\u50a8\u5728\u4e0d\u540c\u7684Registry\u5b58\u50a8\u5e93\u4e2d\u3002<\/li><li>\u4f5c\u4e3a\u4e00\u4e2a\u62bd\u8c61\u5c42\uff0cImageStream\u9690\u85cf\u4e86Image\u7684\u5b9e\u9645\u6765\u6e90\u3002\u5f53\u6784\u5efa\u548c\u90e8\u7f72\u5f15\u7528\u4e00\u4e2aImageStream\u65f6\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4fee\u6539ImageStream\u4e2d\u7684URL\u6765\u6539\u53d8\u6b63\u5728\u4f7f\u7528\u7684Image\uff0c\u800c\u4e0d\u662f\u9010\u4e00\u7f16\u8f91OpenShift\u7684\u6bcf\u4e2a\u6784\u5efa\u548c\u90e8\u7f72\u3002<\/li><li>\u5f53\u521b\u5efa\u6216\u66f4\u65b0Image\u65f6\uff0cImageStream \u901a\u8fc7\u5176\u552f\u4e00\u7684 sha256 ID\uff08\u800c\u975eTag\uff09\u6765\u5f15\u7528Image \u3002\u8fd9\u4f7f\u5f97\u5f53\u5916\u90e8Registry\u53d8\u5316\u6807\u7b7e\u7684\u65f6\u5019\uff0c\u5176\u4f7f\u7528\u7684Image\u53ef\u4fdd\u6301\u7a33\u5b9a\u6027\u3002<\/li><li>ImageStream \u53ef\u4ee5\u5b9a\u671f\uff0815 \u5206\u949f\uff09\u76d1\u63a7\u5916\u90e8\u6807\u8bb0\u662f\u5426\u53d1\u751f\u53d8\u5316\uff08\u901a\u8fc7\u2013scheduled=true\uff09\u3002<\/li><li>\u6211\u4eec\u53ef\u4ee5\u5728\u5185\u90e8Registry\u4e2d\u7f13\u5b58\u5916\u90e8Image\uff08\u901a\u8fc7\u2013reference-policy=local\uff09\u3002\u8fd9\u771f\u7684\u5f88\u6709\u7528\uff0c\u56e0\u4e3a\u5b83\u53ef\u4ee5\u4f7f\u90e8\u7f72\u66f4\u52a0\u5feb\u901f\uff0c\u5e76\u4e14\u4e0d\u53d7\u5916\u90e8Registry\u53ef\u7528\u6027\u7684\u5f71\u54cd\u3002<\/li><li>\u65e0\u8bba\u662f\u5185\u90e8\u8fd8\u662f\u5916\u90e8Image\uff0c\u5728ImageStream\u66f4\u65b0\u65f6\u4f1a\u81ea\u52a8\u89e6\u53d1\u76f8\u5173\u7684BuildConfigs\u548cDeploymentConfigs\u3002<\/li><\/ul>\n\n\n\n<p><strong>\u786e\u5b9aImageStream\u6307\u5411\u7684\u76ee\u6807\u548c\u65b9\u5f0f<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>\u6211\u4eec\u53ef\u4ee5\u628aOpenShift\u7684ImageStream\u770b\u6210\u662f\u4e00\u4e2a\u6307\u5411Image\u7684\u6307\u9488\uff08\u5f53\u7136\u8fd8\u6709\u4e00\u4e9b\u5176\u5b83\u5143\u6570\u636e\uff09\uff0cImageStream\u6307\u5411\u7684Image\u76ee\u6807\u53ef\u4ee5\u662f\u591a\u79cd\u4e0d\u540c\u7c7b\u578b\u7684\u76ee\u6807\uff0c\u5b83\u4eec\u5305\u62ec\uff1a<\/p>\n\n\n\n<ol><li>\u6307\u5411\u4e00\u4e2aexternal image<\/li><li>\u901a\u8fc7pullthrough \u6307\u5411\u4e00\u4e2a\u88ab\u7f13\u5b58\u7684external image<\/li><li>\u603b\u662f\u4f7f\u7528\u4e00\u4e2aexternal image\u7684URL<\/li><li>\u6307\u5411\u4e00\u4e2ainternal image<\/li><li>\u6307\u5411\u53e6\u4e00\u4e2aImageStream<\/li><\/ol>\n\n\n\n<p><strong>\u6307\u5411External Image<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>\u6211\u4eec\u53ef\u4ee5\u7528\u4ee5\u4e0b\u201coc import-image\u201d\u547d\u4ee4\u6216\u201coc tag\u201d\u547d\u4ee4\u521b\u5efa\u4e00\u4e2a\u5b58\u653e\u5728is-project\u4e0b\u7684ImageStream\uff0c\u5e76\u8ba9\u5b83\u6307\u5411\u5916\u90e8Image\uff0c\u8fd9\u4e2a\u5916\u90e8Image\u5c31\u662fdocker.io\/balazsszeti\/hello:sleeper\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ oc new-project is-project\n$ oc import-image is-project\/myimage-ref-source:mytag --from=\"docker.io\/balazsszeti\/hello:sleeper\" --confirm\n$ oc tag docker.io\/balazsszeti\/hello:sleeper is-project\/myimage-ref-source:mytag\n<\/pre>\n\n\n\n<p>\u7136\u540e\u6211\u4eec\u53ef\u4ee5\u67e5\u770b\u8fd9\u4e2aImageStream\u548cImageStreamTag\u7684\u8be6\u7ec6\u4fe1\u606f\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ oc get is myimage-ref-source -oyaml\napiVersion: image.openshift.io\/v1\nkind: ImageStream\nmetadata:\n  annotations:\n    openshift.io\/image.dockerRepositoryCheck: \"2020-04-12T08:18:25Z\"\n  creationTimestamp: \"2020-04-12T08:18:25Z\"\n  generation: 1\n  name: myimage-ref-source\n  namespace: is-project\n  resourceVersion: \"2844402\"\n  selfLink: \/apis\/image.openshift.io\/v1\/namespaces\/is-project\/imagestreams\/myimage-ref-source\n  uid: 2e541461-7c96-11ea-8ba8-0a580a81000f\nspec:\n  lookupPolicy:\n    local: false\n  tags:\n  - from:\n      kind: DockerImage\n      name: docker.io\/balazsszeti\/hello:sleeper\n    importPolicy: {}\n    name: mytag\n    referencePolicy:\n      type: Source\nstatus:\n  dockerImageRepository: image-registry.openshift-image-registry.svc:5000\/is-project\/myimage-ref-source\n  publicDockerImageRepository: default-route-openshift-image-registry.apps.cluster-beijing-78c7.beijing-78c7.example.opentlc.com\/is-project\/myimage-ref-source\n  tags:\n  - items:\n    - created: \"2020-04-12T08:18:25Z\"\n      dockerImageReference: docker.io\/balazsszeti\/hello@sha256:42957024b43e121a210a1b3a8a44f497233a2385f7ef48227a6866afdb9b8e1b\n      generation: 1\n      image: sha256:42957024b43e121a210a1b3a8a44f497233a2385f7ef48227a6866afdb9b8e1b\n    tag: mytag\n \n$ oc get istag\nNAME                       IMAGE REF                                                                                             UPDATED\nmyimage-ref-source:mytag   docker.io\/balazsszeti\/hello@sha256:42957024b43e121a210a1b3a8a44f497233a2385f7ef48227a6866afdb9b8e1b   10 minutes ago\n<\/pre>\n\n\n\n<ol><li>\u540d\u4e3amytag\u7684ImageSteamTag\u6307\u5411\u7684\u662fDockerImage\u7c7b\u578b\u7684External Image\uff0c\u5916\u90e8\u955c\u50cfURL\uff08\u540d\u79f0+Tag\uff09\u662fdocker.io\/balazsszeti\/hello:sleeper\u3002<\/li><li>\u8fd9\u4e2aImageSteam\u7684mytag\u5b9e\u9645\u6307\u5411\u7684\u5916\u90e8Image\u662f\u7531dockerImageReference\u6240\u6307\u7684sha256 ID\uff0c\u5373\u4e0b\u9762\u7684\u5b57\u7b26\u4e32\u3002\u5728\u751f\u6210ImageStreamTag\u7684\u65f6\u5019\uff0cOpenShift\u662f\u4f7f\u7528\u4e86docker.io\/balazsszeti\/hello:sleeper\u83b7\u5f97\u7684\u8be5Image\u7684sha256 ID\u3002\u8fd9\u6837\u5f53\u5728build\u6216deployment\u547d\u4ee4\u4e2d\u5f15\u7528ImageStreamTag\u6765\u521b\u5efaPod\u7684\u65f6\u5019\uff0c\u5b9e\u9645\u4e0a\u4f7f\u7528\u7684\u662f\u7528sha256 ID\u4ee3\u8868\u7684Image\u3002<\/li><\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"> docker.io\/balazsszeti\/hello@sha256:42957024b43e121a210a1b3a8a44f497233a2385f7ef48227a6866afdb9b8e1b<\/pre>\n\n\n\n<ol start=\"3\"><li>\u6bcf\u6b21\u901a\u8fc7ImageSteamTag\u4f7f\u7528Image\u7684\u65f6\u5019\u4f7f\u7528\u7684\u662fsource\u7c7b\u578b\u7684referencePolicy\uff0c\u5373\u76f4\u63a5\u4ecesource\u8bbf\u95eeImage\u3002\u56e0\u6b64\u5982\u679c\u5f53\u65f6\u7f51\u7edc\u4e0d\u901a\uff0c\u5219\u65e0\u6cd5\u8bbf\u95ee\u8be5Image\u3002<\/li><li>\u5f53\u751f\u6210ImageSteamTag\u6307\u5411sha256 ID\u540e\uff0c\u4fee\u6539\u5347\u7ea7\u5916\u90e8\u955c\u50cf\u7684tag\u5c31\u4e0d\u518d\u5f71\u54cdImageSteamTag\u4e86\uff0c\u4e5f\u5c31\u662f\u8bf4\u5373\u4fbf\u628a\u5916\u90e8\u955c\u50cf\u4ece\u201cdocker.io\/balazsszeti\/hello:sleeper\u201d\u6539\u4e3a\u201cdocker.io\/balazsszeti\/hello:sleeper-v1\u201d\uff0c\u53ea\u8981sha256 ID\u6ca1\u6709\u53d8\u5316\uff0cOpenShift\u7684ImageSteamTag\u5c31\u53ef\u4ee5\u7ee7\u7eed\u4f7f\u7528\u8be5\u5916\u90e8\u955c\u50cf\u3002<\/li><li>\u5f53\u5916\u90e8\u955c\u50cf\u53d1\u751f\u53d8\u5316\u540e\u9700\u8981\u81ea\u52a8\u66f4\u65b0ImageSteamTag\u5bf9\u5e94\u7684sha256 ID\uff0c\u90a3\u4e48\u53ef\u4ee5\u4f7f\u7528oc tag\u6216oc import-image\u547d\u4ee4\u7684\u201c\u2013scheduled=true\u201d\u53c2\u6570\uff0c\u5b83\u4f1a\u5728YAML\u4e2d\u8bbe\u7f6e\u201cimportPolicy: {scheduled: true}\u201d\u3002<\/li><li>ImageStream\u662fOpenShift\u6269\u5c55\u7684\u5bf9\u8c61\uff0c\u56e0\u6b64OpenShift\u7684Build\u3001DeploymentConfig\u7b49\u5bf9\u8c61\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\u5b83\u3002\u5982\u679c\u9700\u8981\u5728Kubernetes\u7684RC\u3001Pod\u7b49\u5bf9\u8c61\u4f7f\u7528ImageStream\uff0c\u53ef\u6267\u884c\u4ee5\u4e0b\u7684\u547d\u4ee4\u542f\u52a8ImageStream\u7684\u672c\u5730\u540d\u79f0\u67e5\u8be2\u529f\u80fd\u3002\u8be5\u547d\u4ee4\u5c06\u628aImageStream\u7684Imagestream. spec.lookupPolicy.local\u8bbe\u4e3atrue\u3002<\/li><\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ oc set image-lookup IMAGESTREAM<\/pre>\n\n\n\n<p>\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f8b\u5b50\uff1a\u5982\u679c\u4e3a\u540d\u4e3ahello\u7684ImageStream\u542f\u7528\u4e86\u201c\u672c\u5730\u540d\u79f0\u201d\u67e5\u8be2\u529f\u80fd\uff0c\u90a3\u4e48\u5728pod\u6216\u5176\u4ed6\u8d44\u6e90\u4e2d\u4f7f\u7528\u201c\u2013image=hello\u201d\u5c31\u53ef\u4ee5\u8bbf\u95ee\u5230ImageSteamTag\u6307\u5411\u7684Image\uff0c\u800c\u4e0d\u662f\u6765\u81ea\u4e0a\u6e38Image Registry\u3002\u5982\u679c\u6ca1\u6709\u542f\u52a8\u672c\u5730\u540d\u79f0\u67e5\u8be2\u529f\u80fd\uff0c\u90a3\u4e48\u4f7f\u7528\u201c\u2013image=hello\u201d\u8bbf\u95eeImage\u7684\u65f6\u5019\u4f1a\u51fa\u95ee\u9898\uff0c\u4f8b\u5982\u4e0b\u9762\u7684\u201cErrImagePull\u201d\u9519\u8bef\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ oc import-image is-project\/hello:latest --from=\"openshift\/hello-openshift:latest\" --confirm\n$ oc run hello --image=hello\n$ oc get pod -w\nNAME    READY   STATUS              RESTARTS   AGE\nhello   0\/1     ContainerCreating   0          5s\nhello   0\/1     ErrImagePull        0          10s\n<\/pre>\n\n\n\n<p>\u4e0b\u9762\u5728\u4f7f\u7528\u4e86\u201cset image-lookup\u201d\u540e\u5c31\u53ef\u901a\u8fc7\u201c\u2013image=hello\u201d\u4f7f\u7528\u8be5\u955c\u50cf\u4e86\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ oc delete pod hello\n$ oc set image-lookup hello \n$ oc run hello --image=hello\n$ oc get pod -w\nNAME    READY   STATUS              RESTARTS   AGE\nhello   0\/1     ContainerCreating   0          4s\nhello   1\/1     Running             0          7s\n<\/pre>\n\n\n\n<p><strong>\u901a\u8fc7pullthrough\u6307\u5411External Image<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>\u4e3a\u4e86\u8ba9ImageStream\u4f7f\u7528pullthrough\u7279\u6027\uff0c\u6211\u4eec\u53ef\u4ee5\u5728\u201coc import-image\u201d\u6216\u201coc tag\u201d\u547d\u4ee4\u4e2d\u8bbe\u7f6e\u201c\u2013reference-policy=local\u201d\u53c2\u6570\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ oc import-image is-project\/myimage-ref-local:mytag --from=\"docker.io\/balazsszeti\/hello:sleeper\" --confirm --reference-policy=local\n$ oc tag docker.io\/balazsszeti\/hello:sleeper is-project\/myimage-ref-local:mytag --reference-policy=local\n<\/pre>\n\n\n\n<p>\u201c\u2013reference-policy=local\u201d\u53c2\u6570\u4f1a\u5c06ImageStream\u7684referencePolicy.local\u8bbe\u7f6e\u6210true\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\u3002\u3002\u3002\n  referencePolicy:\n    type: Local\n\u3002\u3002\u3002\n<\/pre>\n\n\n\n<p>\u5f53\u201c\u2013reference-policy=local\u201d\u7684\u65f6\u5019\uff0cStreamImage\u4f7f\u7528\u7684\u662fpullthrough\u65b9\u5f0f\u6307\u5411External Image\uff0c\u90a3\u4e48\uff1a<\/p>\n\n\n\n<ol><li>\u6839\u636eImage\u751f\u6210Pod\u7684\u65f6\u5019\u4f1a\u4f7f\u7528Internal Registry\u4e0a\u7684\u5df2\u7ecf\u88abpulled through\u7684Image\u3002\u4f8b\u5982\uff1a<\/li><\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">image-registry.openshift-image-registry.svc:5000\/is-project\/myimage-ref-local@sha256:42957024b43e121a210a1b3a8a44f497233a2385f7ef48227a6866afdb9b8e1b\n1<\/pre>\n\n\n\n<ol start=\"2\"><li>\u5f53Image\u7b2c\u4e00\u6b21\u88ab\u4f7f\u7528\u7684\u65f6\u540e\uff0c\u5b83\u4f1a\u5148\u4eceExternal Registry\u88ab\u83b7\u53d6\u5230\u7136\u540e\u7f13\u5b58\u5230Internal Registry\u7f13\u5b58\u4e2d\u3002\u6240\u4ee5\u5728\u7b2c\u4e00\u6b21\u4f7f\u7528Image\u7684\u65f6\u540e\u8fd8\u4e0d\u4f1a\u8131\u673a\u5de5\u4f5c\uff0c\u4f46\u4e00\u65e6\u7f13\u5b58\u540e\uff0c\u5c31\u518d\u4e5f\u4e0d\u9700\u8981\u8054\u7cfb\u5916\u90e8\u6ce8\u518c\u8868\u4e86\u3002\u5373\u4f7f\u5c06\u6620\u50cf\u4ece\u5916\u90e8\u6ce8\u518c\u8868\u4e2d\u5220\u9664\uff0c\u5b83\u4e5f\u4f1a\u4fdd\u7559\u5728Internal Registry\u7f13\u5b58\u4e2d\u3002<\/li><li>\u548c\u201c\u6307\u5411External Image\u201d\u4e00\u6837\uff0c\u5f53External Image\u7684Tag\u53d8\u5316\u540e\uff0c\u5e76\u4e14\u5982\u679csha256 ID\u8fd8\u6709\u6548\uff0c\u90a3\u4e48\u4e0d\u4f1a\u5f71\u54cd\u7ee7\u7eed\u4f7f\u7528ImageStreamTag\u8bbf\u95ee\u955c\u50cf\uff0c\u800c\u4e14Internal Registry\u7684Image\u7f13\u5b58\u4e5f\u4e0d\u4f1a\u66f4\u65b0\u3002\u5f53\u4f7f\u7528\u624b\u52a8\u66f4\u65b0\u6216\u4f7f\u7528\u201c\u2013scheduled=true\u201d\u5b9a\u65f6\u66f4\u65b0\uff0c\u66f4\u65b0\u540e\u7684External Image\u4f1a\u66f4\u65b0\u81f3\u5185\u90e8\u7f13\u5b58\u7684Image\u3002<\/li><li>\u7531\u4e8ePod\u662f\u91c7\u7528Internal Registry sha256 ID\u83b7\u53d6\u88ab\u7f13\u5b58\u7684Image\uff0c\u56e0\u6b64\u5982\u679c\u7f13\u5b58Image\u6ca1\u6709\u88ab\u6e05\u9664\uff0c\u90a3\u4e48Pod\u5c31\u53ef\u4ee5\u88abrollback\u3002<\/li><\/ol>\n\n\n\n<p><strong>\u6bcf\u6b21\u901a\u8fc7External Image\u7684URL\u5730\u5740\u83b7\u53d6\u955c\u50cf<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>\u901a\u8fc7\u4f7f\u7528oc tag\u547d\u4ee4\u7684\u2013reference=true\u53c2\u6570\u53ef\u521b\u5efa\u4e00\u4e2aImageStream\u3002\u5728\u901a\u8fc7\u5b83\u8fd0\u884cPod\u7684\u65f6\u5019\uff0cOpenShift\u4e0d\u4f1a\u76f4\u63a5\u4f7f\u7528ImageStreamTag\u7684sha256 ID\u6765\u627e\u5230\u5bf9\u5e94\u7684Image\uff0c\u800c\u662f\u6bcf\u6b21\u90fd\u662f\u901a\u8fc7\u6307\u5b9a\u7684External Image\u540d\u79f0\u548c\u5bf9\u5e94\u7684Tag\u53bb\u627e\u90a3\u4e2a\u5bf9\u5e94\u7279\u5b9a\u7684Image\u3002\u4e0b\u9762\u6211\u4eec\u5bf9\u6bd4\u4f7f\u7528\u2013reference=true\u53c2\u6570\u548c\u2013reference=false\uff08\u7f3a\u7701\u60c5\u51b5\uff09\u7684\u533a\u522b\u3002<\/p>\n\n\n\n<ol><li>\u9996\u5148\u4f7f\u7528\u2013reference=true\u53c2\u6570\u521b\u5efa\u4e00\u4e2aImageStream\uff0c\u7136\u540e\u67e5\u770b\u662f\u5426\u6709ImageStreamTag\u5bf9\u8c61\u3002\u53ef\u4ee5\u770b\u5230\u5f53\u4f7f\u7528\u2013reference=true\u53c2\u6570\u7684\u65f6\u5019\uff0cOpenShift\u5e76\u4e0d\u4f1a\u8bb0\u5f55Image\u7684sha256 ID\u4fe1\u606f\uff08\u4e0d\u8fc7OpenShift\u5b9e\u9645\u662f\u901a\u8fc7sha256 ID\u8bc6\u522b\u88ab\u4f7f\u7528\u7684Image\uff09\u3002\u6b64\u65f6OpenShift\u6bcf\u6b21\u90fd\u8981\u901a\u8fc7\u89e3\u6790External Image\u7684URL\u5730\u5740\uff08\u5373docker.io\/openshift\/hello-openshift:latest\uff09\u89e3\u6790\u5b9e\u9645\u4f7f\u7528\u7684Image\uff08\u5176\u5b9e\u6700\u7ec8\u8fd8\u8981\u89e3\u6790\u5230Image\u7684sha256 ID\uff0c\u53ea\u4e0d\u8fc7\u4e0d\u5728OpenShift\u7684ImageStreamTag\u4e2d\u8bb0\u5f55\u8be5sha256 ID\u4fe1\u606f\u4e86\uff09\u3002\u56e0\u6b64\u8fd9\u79cd\u60c5\u51b5\u662f\u6bcf\u6b21\u8bbf\u95eeImage\u90fd\u505a\u4e00\u6b21\u5916\u90e8\u955c\u50cf\u5730\u5740\u7684\u5168\u89e3\u6790\u3002<\/li><\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ oc tag docker.io\/openshift\/hello-openshift:latest is-project\/hello-1:latest --reference=true\n$ oc get istag hello-1:latest\nError from server (NotFound): imagestreamtags.image.openshift.io \"hello-1:latest\" not found\n123<\/pre>\n\n\n\n<ol start=\"2\"><li>\u9996\u5148\u4f7f\u7528\u2013reference=false\u53c2\u6570\u521b\u5efa\u4e00\u4e2aImageStream\uff0c\u7136\u540e\u67e5\u770b\u662f\u5426\u6709ImageStreamTag\u5bf9\u8c61\u3002\u53ef\u4ee5\u770b\u5230\u5f53\u4f7f\u7528\u2013reference=false\u53c2\u6570\u7684\u65f6\u5019\uff0cOpenShift\u4f1a\u4e3a\u4e4b\u521b\u5efa\u4e0eImageStream\u5bf9\u5e94\u7684ImageStreamTag\u3002OpenShift\u4ee5\u540e\u5b9e\u9645\u4e0a\u662f\u901a\u8fc7ImageStreamTag\u4e2d\u8bb0\u5f55\u7684sha256 ID\u5b9a\u4f4d\u8be5Image\u7684\uff0c\u56e0\u6b64\u4eceExternal Image\u7684URL\u5730\u5740\u89e3\u6790\u5230Image\u7684sha256 ID\u8fc7\u7a0bOpenShift\u53ea\u505a\u4e00\u6b21\u3002<\/li><\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ oc tag docker.io\/openshift\/hello-openshift:latest is-project\/hello-2:latest --reference=false\n$ oc get istag hello-2:latest\nNAME             IMAGE REF                                                                                                     UPDATED\nhello-2:latest   docker.io\/openshift\/hello-openshift@sha256:aaea76ff622d2f8bcb32e538e7b3cd0ef6d291953f3e7c9f556c1ba5baf47e2e   5 seconds ago\n1234<\/pre>\n\n\n\n<p>\u5f53\u6211\u4eec\u4f7f\u7528\u2013reference=true\u7684ImageStream\u7684\u65f6\u5019\uff0c\u5177\u6709\u4ee5\u4e0b\u7279\u6027\uff1a<\/p>\n\n\n\n<ol><li>\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u7531\u4e8eImageStream\u6ca1\u6709\u8bb0\u5f55ImageSteamTag\u7684sha256 ID\u4fe1\u606f\uff0c\u56e0\u6b64\u6bcf\u6b21\u90fd\u8981\u4f7f\u7528\u4ee5\u4e0bExternal Image\u7684URL\u627e\u5230\u8be5Image\u3002<\/li><\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">docker.io\/openshift\/hello-openshift:latest\n1<\/pre>\n\n\n\n<ol start=\"2\"><li>\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u5373\u4fbf\u4f7f\u7528\u4e86\u2013reference-policy=local\u9009\u9879\uff0c\u4e5f\u65e0\u6cd5\u4f7f\u7528\u7f13\u5b58\uff0c\u56e0\u6b64\u4e0d\u80fd\u79bb\u7ebf\u8fd0\u884c\u3002<\/li><li>\u7531\u4e8e\u6bcf\u6b21OpenShift\u90fd\u901a\u8fc7External Image\u7684URL\u627e\u5230\u6240\u7528Tag\u5bf9\u5e94\u7684Image\u6765\u8fd0\u884cPod\uff0c\u56e0\u6b64\u5f53External Image\u7684Tag\u5347\u7ea7\u540e\uff0cOpenShift\u53ef\u4ee5\u7acb\u5373\u611f\u77e5\u51fa\u6765\u8fd9\u79cd\u53d8\u5316\uff0c\u5e76\u7528\u65b0\u7684Tag\u5bf9\u5e94\u7684Image\u751f\u6210Pod\u3002\u5728\u2013reference=false\u7684\u65f6\u5019\uff0c\u5e94\u914d\u5408Pod\u7684\u201cimagePullPolicy: Always\u201d\u53c2\u6570\u4e00\u8d77\u4f7f\u7528\uff0c\u4ee5\u8ba9Pod\u6bcf\u6b21\u90fdpull\u5230\u6700\u65b0\u7684Image\u3002<\/li><li>\u5728\u8fd9\u79cd\u60c5\u51b5\u65f6\uff0cPod\u76f4\u63a5\u4f7f\u7528\u7684\u662fExternal Image URL\u83b7\u53d6\u7684Image\uff0c\u800c\u4e0d\u662f\u7528ImageStream\u914d\u7f6e\u4e2d\u7684Internal Registry URL\uff08\u5373image-registry.openshift-image-registry.svc:5000\/is-project\/myimage-reference:mytag\uff09\u83b7\u53d6Image\u3002<\/li><li>\u7531\u4e8ePod\u662f\u76f4\u63a5\u901a\u8fc7External Image\u7684URL\u83b7\u5f97Image\uff0c\u4f8b\u5982docker.io\/openshift\/hello-openshift:latest\uff0c\u56e0\u6b64\u5373\u4fbfrollback\uff0cPod\u83b7\u53d6\u5230\u7684Image\u53ef\u80fd\u4f1a\u6ca1\u6709\u53d8\u5316\uff0c\u56e0\u6b64rollback\u5c31\u4e0d\u4f1a\u594f\u6548\u3002<\/li><\/ol>\n\n\n\n<p><strong>\u4f7f\u7528Internal Image<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>\u901a\u8fc7OpenShift\u7684build\u751f\u6210\u7684Image\u4f1a\u63a8\u9001\u5230 Internal Registry\u4e0a\uff0cOpenShift\u540c\u65f6\u4f1a\u4e3a\u5176\u751f\u6210ImageStream\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ oc new-app php~https:\/\/github.com\/liuxiaoyu-git\/php-helloworld\n \n$ oc get istag php-helloworld:latest\nNAME                    IMAGE REFERENCE                                                                                                                                      UPDATED\nphp-helloworld:latest   image-registry.openshift-image-registry.svc:5000\/is-project\/php-helloworld@sha256:759da8784d4c130ff6784fa375141fa65b949ac12eae4f98d537241cb49d6060   3 minutes ago\n12345<\/pre>\n\n\n\n<p>\u4f7f\u7528\u8fd9\u79cd\u65b9\u5f0f\u7684ImageStream\u6709\u4ee5\u4e0b\u7279\u6027\uff1a<\/p>\n\n\n\n<ol><li>\u540c\u4f7f\u7528pullthrough\u65b9\u5f0f\u76f8\u540c\uff0cPod\u4f7f\u7528\u7684\u662fInternal Registry\u548csha256 ID\u7684\u7ec4\u5408\u65b9\u5f0f\u8bbf\u95ee\u5230Image\u3002<\/li><\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">image-registry.openshift-image-registry.svc:5000\/is-project\/php-helloworld@sha256:759da8784d4c130ff6784fa375141fa65b949ac12eae4f98d537241cb49d6060\n1<\/pre>\n\n\n\n<ol start=\"2\"><li>\u7531\u4e8eImage\u5c31\u5728OpenShift\u7684internal registry\u4e2d\uff0c\u56e0\u6b64\u53ef\u4ee5\u79bb\u7ebf\u8bbf\u95ee\u5230\u3002<\/li><li>\u5f53\u901a\u8fc7build\u8fc7\u7a0b\u66f4\u65b0\u4e86Image\u7684Tag\u540e\uff0cPod\u4f1a\u4f7f\u7528\u66f4\u65b0\u540e\u7684Image\u3002<\/li><li>\u5176\u5b83\u7279\u6027\u548c\u4e0a\u9762\u4ecb\u7ecd\u7684pullthrough\u7684\u60c5\u51b5\u76f8\u540c\u3002<\/li><\/ol>\n","protected":false},"excerpt":{"rendered":"<p>\u6709\u5173ImageStream\u7684\u5165\u95e8\u64cd\u4f5c\u53ef\u53c2\u89c1\uff1a\u300a OpenShift 4 Hands-on Lab (3) &#038;# [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22],"tags":[],"_links":{"self":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/10297"}],"collection":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10297"}],"version-history":[{"count":11,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/10297\/revisions"}],"predecessor-version":[{"id":10346,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/10297\/revisions\/10346"}],"wp:attachment":[{"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10297"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10297"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10297"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}