{"id":18255,"date":"2024-11-18T08:25:17","date_gmt":"2024-11-18T00:25:17","guid":{"rendered":"https:\/\/fwq.ai\/blog\/18255\/"},"modified":"2024-11-18T08:25:17","modified_gmt":"2024-11-18T00:25:17","slug":"docker%e9%95%9c%e5%83%8f%e6%80%8e%e4%b9%88%e5%af%bc%e5%87%ba","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/18255\/","title":{"rendered":"docker\u955c\u50cf\u600e\u4e48\u5bfc\u51fa"},"content":{"rendered":"<blockquote><p>\n  docker \u955c\u50cf\u5bfc\u51fa\u6709\u4e24\u79cd\u65b9\u6cd5\uff1a\u5c06\u955c\u50cf\u4fdd\u5b58\u81f3 tar \u6587\u4ef6\u6216\u63a8\u9001\u5230\u6ce8\u518c\u8868\u3002\u5bfc\u51fa\u7684\u955c\u50cf\u53ef\u901a\u8fc7\u52a0\u8f7d\u81f3\u672c\u5730 docker \u5b88\u62a4\u8fdb\u7a0b\u6216\u4ece\u6ce8\u518c\u8868\u4e2d\u62c9\u53d6\u4f7f\u7528\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202406\/05\/2024060506421797401.jpg\" class=\"aligncenter\" title=\"docker\u955c\u50cf\u600e\u4e48\u5bfc\u51fa\u63d2\u56fe\" alt=\"docker\u955c\u50cf\u600e\u4e48\u5bfc\u51fa\u63d2\u56fe\" \/><\/p>\n<p><strong>Docker \u955c\u50cf\u5bfc\u51fa<\/strong><\/p>\n<p><strong>\u5982\u4f55\u5bfc\u51fa Docker \u955c\u50cf\uff1f<\/strong><\/p>\n<p>\u5bfc\u51fa Docker \u955c\u50cf\u53ef\u4ee5\u5c06\u5176\u4fdd\u5b58\u5230\u672c\u5730\u6216\u8fdc\u7a0b\u6ce8\u518c\u8868\u4e2d\uff0c\u4ee5\u4fbf\u5728\u5176\u4ed6\u673a\u5668\u4e0a\u4f7f\u7528\u3002\u6709\u4e24\u79cd\u5e38\u89c1\u7684\u65b9\u6cd5\uff1a<\/p>\n<p><strong>\u65b9\u6cd5 1\uff1a\u5bfc\u51fa\u5230 TAR \u6587\u4ef6<\/strong><\/p>\n<pre>docker save [IMAGE_NAME] &gt; [EXPORT_FILE].tar<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4f8b\u5982\uff1a\u5c06\u540d\u4e3a &#8220;my-image&#8221; \u7684\u955c\u50cf\u5bfc\u51fa\u5230\u540d\u4e3a &#8220;my-image.tar&#8221; \u7684 TAR \u6587\u4ef6\u4e2d\uff1a<\/p>\n<pre>docker save my-image &gt; my-image.tar<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u65b9\u6cd5 2\uff1a\u5bfc\u51fa\u5230\u6ce8\u518c\u8868<\/strong><\/p>\n<pre>docker push [IMAGE_NAME] [REGISTRY_URL]\/[REPOSITORY_NAME]<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4f8b\u5982\uff1a\u5c06\u540d\u4e3a &#8220;my-image&#8221; \u7684\u955c\u50cf\u63a8\u9001\u5230\u540d\u4e3a &#8220;my-registry&#8221; \u7684\u6ce8\u518c\u8868\u4e2d\u7684 &#8220;my-repository&#8221; \u5b58\u50a8\u5e93\u4e2d\uff1a<\/p>\n<pre>docker push my-image my-registry.io\/my-repository<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u5bfc\u51fa\u540e\u7684\u955c\u50cf\u5982\u4f55\u4f7f\u7528\uff1f<\/strong><\/p>\n<p>\u5bfc\u51fa\u7684\u955c\u50cf\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u4f7f\u7528\uff1a<\/p>\n<ul>\n<li>\n<p><strong>\u52a0\u8f7d\u5230\u672c\u5730 Docker \u5b88\u62a4\u8fdb\u7a0b\uff1a<\/strong><\/p>\n<pre>docker load &lt; [IMPORT_FILE].tar<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/li>\n<li>\n<p><strong>\u4ece\u6ce8\u518c\u8868\u62c9\u53d6\uff1a<\/strong><\/p>\n<pre>docker pull [REGISTRY_URL]\/[REPOSITORY_NAME]<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u955c\u50cf\u600e\u4e48\u5bfc\u51fa\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>docker \u955c\u50cf\u5bfc\u51fa\u6709\u4e24\u79cd\u65b9\u6cd5\uff1a\u5c06\u955c\u50cf\u4fdd\u5b58\u81f3 tar \u6587\u4ef6\u6216\u63a8\u9001\u5230\u6ce8\u518c\u8868\u3002\u5bfc\u51fa\u7684\u955c\u50cf\u53ef\u901a\u8fc7\u52a0\u8f7d\u81f3\u672c\u5730 docker \u5b88\u62a4\u8fdb\u7a0b\u6216\u4ece\u6ce8\u518c\u8868\u4e2d\u62c9\u53d6\u4f7f\u7528\u3002 Docker \u955c\u50cf\u5bfc\u51fa \u5982\u4f55\u5bfc\u51fa Docker \u955c\u50cf\uff1f \u5bfc\u51fa Docker \u955c\u50cf\u53ef\u4ee5\u5c06\u5176\u4fdd\u5b58\u5230\u672c\u5730\u6216\u8fdc\u7a0b\u6ce8\u518c\u8868\u4e2d\uff0c\u4ee5\u4fbf\u5728\u5176\u4ed6\u673a\u5668\u4e0a\u4f7f\u7528\u3002\u6709\u4e24\u79cd\u5e38\u89c1\u7684\u65b9\u6cd5\uff1a \u65b9\u6cd5 1\uff1a\u5bfc\u51fa\u5230 TAR \u6587\u4ef6 docker save [IMAGE_NAME] &gt; [EXPORT_FILE].tar \u767b\u5f55\u540e\u590d\u5236 \u4f8b\u5982\uff1a\u5c06\u540d\u4e3a &#8220;my-image&#8221; \u7684\u955c\u50cf\u5bfc\u51fa\u5230\u540d\u4e3a &#8220;my-image.tar&#8221; \u7684 TAR \u6587\u4ef6\u4e2d\uff1a docker save my-image &gt; my-image.tar \u767b\u5f55\u540e\u590d\u5236 \u65b9\u6cd5 2\uff1a\u5bfc\u51fa\u5230\u6ce8\u518c\u8868 docker push [IMAGE_NAME] [REGISTRY_URL]\/[REPOSITORY_NAME] \u767b\u5f55\u540e\u590d\u5236 \u4f8b\u5982\uff1a\u5c06\u540d\u4e3a &#8220;my-image&#8221; \u7684\u955c\u50cf\u63a8\u9001\u5230\u540d\u4e3a &#8220;my-registry&#8221; \u7684\u6ce8\u518c\u8868\u4e2d\u7684 &#8220;my-repository&#8221; \u5b58\u50a8\u5e93\u4e2d\uff1a docker push my-image my-registry.io\/my-repository [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-18255","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/18255","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=18255"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/18255\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=18255"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=18255"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=18255"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}