{"id":5714,"date":"2022-05-09T10:21:51","date_gmt":"2022-05-09T02:21:51","guid":{"rendered":"http:\/\/123.57.164.21\/?p=5714"},"modified":"2023-03-28T22:08:24","modified_gmt":"2023-03-28T14:08:24","slug":"openshift-%e7%9a%84-image-registry%e3%80%81image-%e5%92%8c-imagestream-%e6%a6%82%e5%bf%b5","status":"publish","type":"post","link":"https:\/\/92it.top\/?p=5714","title":{"rendered":"OpenShift \u7684 Image Registry\u3001Image \u548c ImageStream \u6982\u5ff5"},"content":{"rendered":"\n<h6 class=\"wp-block-heading\"><strong>Container Image\uff08\u5bb9\u5668\u955c\u50cf\uff09<\/strong><\/h6>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>\u4e0d\u7528\u518d\u89e3\u91ca\u4e86\uff0c\u5c31\u662f\u5bb9\u5668\u955c\u50cf\u3002\u4ee5\u524d\u53eb<a rel=\"noreferrer noopener\" href=\"https:\/\/so.csdn.net\/so\/search?q=Docker&amp;spm=1001.2101.3001.7020\" target=\"_blank\">Docker<\/a> Image\uff0c\u73b0\u5728\u53ebContainer Image\u66f4\u51c6\u786e\u4e9b\uff0c\u56e0\u4e3a\u6709\u4e86OCI\u5bb9\u5668\u89c4\u8303\u540e\uff0c\u5bb9\u5668\u4e0d\u518d\u662fDocker\u4e00\u5bb6\u7684\u4e86\u3002<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">ImageStream<\/h6>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>ImageStream\u662f<a rel=\"noreferrer noopener\" href=\"https:\/\/so.csdn.net\/so\/search?q=OpenShift&amp;spm=1001.2101.3001.7020\" target=\"_blank\">OpenShift<\/a>\u72ec\u6709\u7684\u4e00\u79cd\u5bf9\u8c61\uff0c\u5728Kubernetes\u4e2d\u6ca1\u6709\u5bf9\u5e94\u7684\u5bf9\u8c61\u3002\u5b83\u4e3b\u8981\u76ee\u6807\u662f\u7b80\u5316\u5bb9\u79ef\u955c\u50cf\u7ba1\u7406\uff0c\u673a\u5236\u5c31\u662f\u901a\u8fc7\u4f7f\u7528\u6807\u7b7e\u5b9e\u73b0\u955c\u50cf\u6307\u9488\u3002ImageStream\u5305\u62ec\u4e00\u7cfb\u5217\u201d\u6807\u7b7e\u6307\u9488\u201c\u6307\u5411\u5b9e\u9645\u7684\u5bb9\u5668\uff0c\u4f8b\u5982\u4e0b\u56fe\u6709latest\u30018\u548c7\u7248\u672c\u7684\u5bb9\u5668\u6307\u9488\uff0c\u5b83\u4eec\u5206\u522b\u6307\u5411\u4e86\u4e0d\u540c\u4f4d\u7f6e\u548c\u7248\u672c\u7684\u5bb9\u5668\u955c\u50cf\u3002ImageStream\u672c\u8eab\u5e76\u4e0d\u4fdd\u5b58\u955c\u50cf\uff0c\u800c\u662f\u53ea\u4fdd\u5b58\u5bb9\u5668\u5143\u6570\u636e\u548c\u201d\u6807\u7b7e\u6307\u9488\u201c\u3002<\/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\/2022\/05\/\u56fe\u7247-16-1024x436.png\" alt=\"\" class=\"wp-image-5715\" width=\"532\" height=\"226\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-16-1024x436.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-16-300x128.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-16-768x327.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-16-830x353.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-16-230x98.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-16-350x149.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-16-480x204.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-16.png 1376w\" sizes=\"(max-width: 532px) 100vw, 532px\" \/><\/figure><\/div>\n\n\n\n<p>ImageStream\u8bb0\u5f55OpenShift\u4f7f\u7528\u7684<a href=\"https:\/\/so.csdn.net\/so\/search?q=Container&amp;spm=1001.2101.3001.7020\" target=\"_blank\" rel=\"noreferrer noopener\">Container<\/a> Image\u7684\u5143\u6570\u636e\uff0c\u8fd9\u4e9b\u5143\u6570\u636e\u5305\u62ec\uff1a<\/p>\n\n\n\n<ul><li>ImageStreamTag: \u6307\u5411Container Image\u7684\u6807\u7b7e\u3002<\/li><li>ImageStreamImage: \u662fImageStreamTag\u5b9e\u9645\u6307\u5411\u7684Image\u3002<\/li><li>ImageStreamTrigger: \u5f53ImageStreamImage\u53d1\u751f\u53d8\u5316\u540e\uff0c\u901a\u8fc7ImageStreamTrigger\u53ef\u83b7\u53d6\u8be5\u4e8b\u4ef6\u3002\u901a\u5e38\u4f7f\u7528ImageStreamTrigger\u89e6\u53d1\u4f9d\u8d56\u53d8\u5316Image\u7684\u4e0a\u5c42Image\u8fdb\u884c\u81ea\u52a8\u955c\u50cf\u66f4\u65b0\u3002<\/li><\/ul>\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\/2022\/05\/\u56fe\u7247-17-1024x447.png\" alt=\"\" class=\"wp-image-5716\" width=\"546\" height=\"237\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-17-1024x447.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-17-300x131.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-17-768x335.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-17-830x362.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-17-230x100.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-17-350x153.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-17-480x209.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-17.png 1320w\" sizes=\"(max-width: 546px) 100vw, 546px\" \/><\/figure><\/div>\n\n\n\n<h6 class=\"wp-block-heading\">Internal Registry\u548cExternal Registry<\/h6>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>OpenShift\u5185\u90e8\u81ea\u5e26Image Registry\u7528\u6765\u4fdd\u5b58\u4e24\u7c7bContainer Image\u3002<\/p>\n\n\n\n<ul><li>Base Image\uff1a\u987e\u540d\u601d\u4e49\uff0c\u5c31\u662f\u5e94\u7528\u4f7f\u7528\u7684\u57fa\u7840\u955c\u50cf\u3002Base Image\u91cc\u4e3b\u8981\u5305\u62ec\u5e94\u7528\u8fd0\u884c\u73af\u5883\uff0c\u4e00\u822c\u4e0d\u5305\u62ec\u5e94\u7528\u4ee3\u7801\u3002\u4f8b\u5982Java\u5e94\u7528\u7684Base Image\u81f3\u5c11\u8981\u5305\u62ecJDK\u3002<\/li><\/ul>\n\n\n\n<ul><li>App Image\uff1a\u5373\u5c06\u5e94\u7528+Base Image\u6253\u5305\u7684\u5e94\u7528\u955c\u50cf\u3002 OpenShift\u5185\u90e8\u81ea\u5e26Image Registry\u548c\u5916\u90e8Image Registry\u7684\u5173\u7cfb\u5982\u4e0b\u56fe\u3002Base Image\u53ef\u4ee5\u7531OpenShift\u81ea\u52a8\u4eceExternal Registry\u4e0a\u62c9\u5230Internal Registry\uff0c\u53e6\u5916OpenShift\u4f1a\u5c06\u6784\u5efa\u597d\u7684App Image\u63a8\u9001\u5230Internal Registry\u3002<\/li><\/ul>\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\/2022\/05\/\u56fe\u7247-18-1024x702.png\" alt=\"\" class=\"wp-image-5717\" width=\"490\" height=\"334\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-18-230x158.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-18-350x240.png 350w\" sizes=\"(max-width: 490px) 100vw, 490px\" \/><\/figure><\/div>\n\n\n\n<p><strong>\u64cd\u4f5c\u7bc7<\/strong><\/p>\n\n\n\n<p><strong>\u6839\u636eImageStream\u7684Image\u5143\u6570\u636e\u81ea\u52a8\u62c9\u53d6\u5bb9\u5668\u955c\u50cf<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>1.\u6267\u884c\u547d\u4ee4\u521b\u5efa\u9879\u76eemy-container-image\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 my-container-image<\/pre>\n\n\n\n<p>2.\u7136\u540e\u83b7\u53d6\u7684\u5bb9\u5668\u5143\u6570\u636e\uff0c\u5e76\u5efa\u7acbImageStream\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=\"\">#\u65b9\u6cd51\uff1a\u4e3adockerhub\u4e0a\u7684openshift\/deployment-example:v1\u955c\u50cf\u6253\u6807\u7b7edeployment-example:v1\n$ oc tag docker.io\/openshift\/deployment-example:v1 deployment-example:v1\n\n#\u65b9\u6cd52\uff1a\u5bfc\u5165\u5916\u90e8Image\u7684\u5143\u6570\u636e\u5230OOpenShift\n$ oc import-image docker.io\/openshift\/deployment-example:v1 --confirm\n<\/pre>\n\n\n\n<p>3.\u5728\u5bf9\u5916\u90e8\u955c\u50cf\u6253\u6807\u7b7e\u540e\uff0cOpenShift\u4f1a\u81ea\u52a8\u83b7\u53d6Image\u5143\u6570\u636e\uff0c\u5e76\u5728OpenShift\u4e2d\u901a\u8fc7ImageStream\uff08\u7b80\u5199 IS\uff09\u8bb0\u5f55\u8fd9\u4e9bImage\u7684\u5143\u6570\u636e\u4fe1\u606f\u3002\u6267\u884c\u547d\u4ee4\u67e5\u770bImageStream\u4fe1\u606f\uff0c\u4e0b\u9762\u662f\u5305\u62ectag\u4e3av1\u7248\u5bb9\u5668\u955c\u50cf\u7684ImageStream\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 describe is deployment-example\nNamespace:\t\tmy-container-image\nCreated:\t\t9 minutes ago\nLabels:\t\t\t&lt;none>\nAnnotations:\t\topenshift.io\/image.dockerRepositoryCheck=2019-12-06T06:23:26Z\nImage Repository:\tdefault-route-openshift-image-registry.apps-crc.testing\/my-container-image\/deployment-example\nImage Lookup:\t\tlocal=false\nUnique Images:\t\t1\nTags:\t\t\t1\nv1\n  tagged from docker.io\/openshift\/deployment-example:v1\n  *docker.io\/openshift\/deployment-example@sha256:c505b916f7e5143a356ff961f2c21aee40fbd2cd906c1e3feeb8d5e978da284b\n<\/pre>\n\n\n\n<p>4.\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff0c\u67e5\u770bImageStream\u7684tag\u5217\u8868\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 istag\nNAME                    IMAGE REF                                                                                                        UPDATED\ndeployment-example:v1   docker.io\/openshift\/deployment-example@sha256:c505b916f7e5143a356ff961f2c21aee40fbd2cd906c1e3feeb8d5e978da284b   12 minutes ago\n<\/pre>\n\n\n\n<p>5.\u67e5\u770b\u4e0a\u9762istag\u6307\u5411Image\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u5176\u4e2d\u5305\u62ec\u5206\u5c42\u6587\u4ef6\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 istag\nNAME                    IMAGE REF                                                                                                        UPDATED\ndeployment-example:v1   docker.io\/openshift\/deployment-example@sha256:c505b916f7e5143a356ff961f2c21aee40fbd2cd906c1e3feeb8d5e978da284b   12 minutes ago\n[dawnsky@rhel76 crc]$ oc describe istag deployment-example:v1\nImage Name:\tsha256:c505b916f7e5143a356ff961f2c21aee40fbd2cd906c1e3feeb8d5e978da284b\nDocker Image:\tdocker.io\/openshift\/deployment-example@sha256:c505b916f7e5143a356ff961f2c21aee40fbd2cd906c1e3feeb8d5e978da284b\nName:\t\tsha256:c505b916f7e5143a356ff961f2c21aee40fbd2cd906c1e3feeb8d5e978da284b\nCreated:\t14 minutes ago\nAnnotations:\timage.openshift.io\/dockerLayersOrder=ascending\nImage Size:\t5.77MB in 6 layers\nLayers:\t\t0B\tsha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4\n\t\t5.77MB\tsha256:50438f3701c47319ff1c8189ff19f5a8c779f2479aa2066979b930c7dbb3bde8\n\t\t0B\tsha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4\n\t\t0B\tsha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4\n\t\t0B\tsha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4\n\t\t0B\tsha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4\nImage Created:\t4 years ago\nAuthor:\t\tClayton Coleman &lt;ccoleman@redhat.com>\nArch:\t\tamd64\nEntrypoint:\t\/deployment v1\nWorking Dir:\t&lt;none>\nUser:\t\t&lt;none>\nExposes Ports:\t8080\/tcp\nDocker Labels:\t&lt;none>\nEnvironment:\tCOLOR=#006e9c\n<\/pre>\n\n\n\n<p>6.\u57fa\u4e8eImageStream\u7684v1\u6307\u5411\u7684Image\u521b\u5efa\u5e94\u7528\u3002\u6700\u540e\u8bbf\u95ee\u5e94\u7528\uff0c\u53ef\u4ee5\u770b\u5230\u9875\u9762\u8fd4\u56de\u7684<strong>v1\u7248<\/strong>\u7684\u5e94\u7528\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 my-container-image\/deployment-example:v1\n$ oc expose svc deployment-example\n$ curl $(oc get route deployment-example -o template --template '{{.spec.host}}') | grep h1\n<\/pre>\n\n\n\n<p>7.\u6267\u884c\u547d\u4ee4\u67e5\u770bevents\u4e8b\u4ef6\uff0c\u53ef\u4ee5\u770b\u5230\u67093\u9879\uff0c\u5176\u4e2d\u540d\u4e3adeployment-example\u7684Image\u662f\u5728\u7b2c\u4e00\u6b21\u90e8\u7f72\u5e94\u7528\u7684\u65f6\u5019\u624d\u4ece\u7f51\u4e0apulled\u5230OpenShift\u672c\u5730\u7684Internal Registry\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 events | grep Pull\n15m         Normal   Pulled              pod\/deployment-example-1-deploy              Container image \"quay.io\/openshift-release-dev\/ocp-v4.0-art-dev@sha256:9ac5a8dceed67e3c3e1c018dc581bf5f03d77a20a2f1ca1bf00c32b5e75b19f6\" already present on machine\n14m         Normal   Pulling             pod\/deployment-example-1-djw48               Pulling image \"openshift\/deployment-example@sha256:c505b916f7e5143a356ff961f2c21aee40fbd2cd906c1e3feeb8d5e978da284b\"\n14m         Normal   Pulled              pod\/deployment-example-1-djw48               Successfully pulled im\n<\/pre>\n\n\n\n<p><strong>\u589e\u52a0\u6807\u7b7e<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>1.\u5728ImageStream\u4e2d\u589e\u52a0\u201clatest\u201d\u7684\u6807\u7b7e\uff0c\u5e76\u8ba9\u5b83\u6307\u5411v1\u7248\u7684Image\u3002\u6b64\u65f6\u53ef\u4ee5\u770b\u5230v1\u548clatest\u6307\u5411\u7684\u540c\u4e00\u4e2aImage\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 tag docker.io\/openshift\/deployment-example:v1 deployment-example:latest\n$ oc get istag\nNAME                        IMAGE REF                                                                                                        UPDATED\ndeployment-example:latest   docker.io\/openshift\/deployment-example@sha256:c505b916f7e5143a356ff961f2c21aee40fbd2cd906c1e3feeb8d5e978da284b   8 seconds ago\ndeployment-example:v1       docker.io\/openshift\/deployment-example@sha256:c505b916f7e5143a356ff961f2c21aee40fbd2cd906c1e3feeb8d5e978da284b   19 minutes ago\n<\/pre>\n\n\n\n<p>2.\u8bbe\u7f6eImageStream\u7684latest\u6807\u7b7e\u6307\u5411v2\u7248\u7684Image\u3002\u7136\u540e\u901a\u8fc7\u67e5\u770bImageStream\u4fe1\u606f\uff0c\u5176\u4e2d\u8bb0\u5f55\u4e86\u6bcf\u4e2atag\u6307\u5411\u7684\u5386\u53f2Image\u3002\u53ef\u4ee5\u770b\u5230\u5f53\u524dlatest\u6307\u5411v2\u7684Image\uff0c\u4e0d\u8fc7\u4ee5\u524d\u6307\u5411\u7684\u662fv1\u7684Image\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 tag docker.io\/openshift\/deployment-example:v2 deployment-example:latest\n$ oc describe is deployment-example\nName:\t\t\tdeployment-example\nNamespace:\t\tmy-container-image\nCreated:\t\t26 minutes ago\nLabels:\t\t\t&lt;none>\nAnnotations:\t\topenshift.io\/image.dockerRepositoryCheck=2019-12-06T07:50:11Z\nImage Repository:\tdefault-route-openshift-image-registry.apps-crc.testing\/my-container-image\/deployment-example\nImage Lookup:\t\tlocal=false\nUnique Images:\t\t2\nTags:\t\t\t2\n\nlatest\n  tagged from docker.io\/openshift\/deployment-example:v2\n\n  * docker.io\/openshift\/deployment-example@sha256:1318f08b141aa6a4cdca8c09fe8754b6c9f7802f8fc24e4e39ebf93e9d58472b\n      4 minutes ago\n    docker.io\/openshift\/deployment-example@sha256:c505b916f7e5143a356ff961f2c21aee40fbd2cd906c1e3feeb8d5e978da284b\n      7 minutes ago\n\nv1\n  tagged from docker.io\/openshift\/deployment-example:v1\n\n  * docker.io\/openshift\/deployment-example@sha256:c505b916f7e5143a356ff961f2c21aee40fbd2cd906c1e3feeb8d5e978da284b\n      26 minutes ago\n<\/pre>\n\n\n\n<p><strong>\u5220\u9664\u5e76\u6062\u590d\u6807\u7b7e<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>1.\u5220\u9664ImageStream\u4e2dv1\u7684tag\u3002\u7136\u540e\u518d\u67e5\u770bImageStream\uff0c\u786e\u8ba4\u5df2\u7ecf\u6ca1\u6709\u5355\u72ec\u7684v1\u7248tag\u7684\u4fe1\u606f\u4e86\u3002\u4f46\u662f\u8fd8\u53ef\u901a\u8fc7latest\u7684\u5386\u53f2\u67e5\u5230v1\u7248tag\u6307\u5411\u7684ImageStreamImage\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 tag -d deployment-example:v1\n$ oc describe is deployment-example\nName:\t\t\tdeployment-example\nNamespace:\t\tmy-container-image\nCreated:\t\t45 minutes ago\nLabels:\t\t\t&lt;none>\nAnnotations:\t\topenshift.io\/image.dockerRepositoryCheck=2019-12-06T07:50:11Z\nImage Repository:\tdefault-route-openshift-image-registry.apps-crc.testing\/my-container-image\/deployment-example\nImage Lookup:\t\tlocal=false\nUnique Images:\t\t2\nTags:\t\t\t1\nlatest\n  tagged from docker.io\/openshift\/deployment-example:v2\n\n  * docker.io\/openshift\/deployment-example@sha256:1318f08b141aa6a4cdca8c09fe8754b6c9f7802f8fc24e4e39ebf93e9d58472b\n      23 minutes ago\n    docker.io\/openshift\/deployment-example@sha256:c505b916f7e5143a356ff961f2c21aee40fbd2cd906c1e3feeb8d5e978da284b\n      25 minutes ago\n<\/pre>\n\n\n\n<p>2.\u4ece\u5386\u53f2\u7684ImageStreamImage\u6062\u590distag\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 tag --source=docker openshift\/deployment-example@sha256:c505b916f7e5143a356ff961f2c21aee40fbd2cd906c1e3feeb8d5e978da284b deployment-example:v1\n$ oc get istag<\/pre>\n\n\n\n<p><strong>\u5176\u5b83\u955c\u50cf\u64cd\u4f5c<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<ol><li>\u53c2\u8003\u300a<a href=\"https:\/\/blog.csdn.net\/weixin_43902588\/article\/details\/103361922\">OpenShift 4 \u4e4b\u901a\u8fc7\u76f4\u63a5\u8bbf\u95ee\u5185\u90e8\u7684 Image Registry \u64cd\u4f5c\u5bb9\u5668\u955c\u50cf<\/a>\u300b\uff0c\u5b9e\u73b0\u5bf9Internal Registry\u7684\u76f4\u63a5\u64cd\u4f5c\u3002<\/li><li>\u67e5\u770b\u6240\u6709ImageStreamImage\uff08\u5373ImageStream\u5305\u62ec\u7684\u6bcf\u4e2a\u4ee5\u7248\u672c\u7684Image\uff09\u7684\u955c\u50cf\u5927\u5c0f\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 adm top images<\/pre>\n\n\n\n<p>3.\u67e5\u770b\u6240\u6709ImageStream\u7684\u5927\u5c0f\uff08\u5305\u62ec\u4e86\u6bcf\u4e2aImageStream\u4e2d\u6240\u6709ImageStreamImage\uff09\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 adm top imagestreams<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Container Image\uff08\u5bb9\u5668\u955c\u50cf\uff09 \u4e0d\u7528\u518d\u89e3\u91ca\u4e86\uff0c\u5c31\u662f\u5bb9\u5668\u955c\u50cf\u3002\u4ee5\u524d\u53ebDocker Image\uff0c\u73b0\u5728\u53eb [&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\/5714"}],"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=5714"}],"version-history":[{"count":2,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/5714\/revisions"}],"predecessor-version":[{"id":10309,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/5714\/revisions\/10309"}],"wp:attachment":[{"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5714"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5714"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5714"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}