{"id":18285,"date":"2024-11-18T10:18:13","date_gmt":"2024-11-18T02:18:13","guid":{"rendered":"https:\/\/fwq.ai\/blog\/18285\/"},"modified":"2024-11-18T10:18:13","modified_gmt":"2024-11-18T02:18:13","slug":"docker%e6%80%8e%e4%b9%88%e5%af%bc%e5%85%a5%e9%95%9c%e5%83%8f%e6%96%87%e4%bb%b6","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/18285\/","title":{"rendered":"docker\u600e\u4e48\u5bfc\u5165\u955c\u50cf\u6587\u4ef6"},"content":{"rendered":"<blockquote><p>\n  docker \u955c\u50cf\u6587\u4ef6\u7684\u4e24\u79cd\u5bfc\u5165\u65b9\u6cd5\uff1a\u76f4\u63a5\u5bfc\u5165\u955c\u50cf\u540d\u79f0\uff1adocker pull [\u955c\u50cf\u540d\u79f0]\u5bfc\u5165 tar \u5f52\u6863\u6587\u4ef6\uff1adocker load <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202406\/05\/2024060508303577726.jpg\" class=\"aligncenter\" title=\"docker\u600e\u4e48\u5bfc\u5165\u955c\u50cf\u6587\u4ef6\u63d2\u56fe\" alt=\"docker\u600e\u4e48\u5bfc\u5165\u955c\u50cf\u6587\u4ef6\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5bfc\u5165 Docker \u955c\u50cf\u6587\u4ef6<\/strong><\/p>\n<p><strong>\u5bfc\u5165\u955c\u50cf\u6587\u4ef6<\/strong><\/p>\n<p>\u5bfc\u5165 Docker \u955c\u50cf\u6587\u4ef6\u7684\u65b9\u6cd5\u6709\u4e24\u79cd\uff1a<\/p>\n<ul>\n<li> <strong>\u76f4\u63a5\u5bfc\u5165\u955c\u50cf\u540d\u79f0\uff1a<\/strong>\u5982\u679c\u955c\u50cf\u5df2\u5728 Docker \u4ed3\u5e93\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u76f4\u63a5\u5bfc\u5165\uff1a<\/li>\n<\/ul>\n<pre>docker pull [\u955c\u50cf\u540d\u79f0]<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ul>\n<li> <strong>\u5bfc\u5165 tar \u5f52\u6863\u6587\u4ef6\uff1a<\/strong>\u5982\u679c\u955c\u50cf\u662f\u672c\u5730 tar \u5f52\u6863\u6587\u4ef6\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5bfc\u5165\uff1a<\/li>\n<\/ul>\n<pre>docker load &lt; [\u955c\u50cf\u6587\u4ef6\u8def\u5f84]<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u8be6\u7ec6\u6b65\u9aa4\uff1a<\/strong><\/p>\n<p><strong>1. \u76f4\u63a5\u5bfc\u5165\u955c\u50cf\u540d\u79f0<\/strong><\/p>\n<ul>\n<li>\u6253\u5f00\u547d\u4ee4\u884c\u7ec8\u7aef\u3002<\/li>\n<li>\u8fd0\u884c  pull \u547d\u4ee4\uff0c\u540e\u8ddf\u8981\u5bfc\u5165\u7684\u955c\u50cf\u540d\u79f0\u3002\u4f8b\u5982\uff1a<\/li>\n<\/ul>\n<pre>docker pull nginx<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fd9\u5c06\u4ece Docker \u4ed3\u5e93\u4e2d\u62c9\u53d6 Nginx \u955c\u50cf\u5e76\u5c06\u5176\u5bfc\u5165\u672c\u5730\u3002<\/p>\n<p><strong>2. \u5bfc\u5165 tar \u5f52\u6863\u6587\u4ef6<\/strong><\/p>\n<ul>\n<li>\u5c06 tar \u5f52\u6863\u6587\u4ef6\u4fdd\u5b58\u5230\u672c\u5730\u3002<\/li>\n<li>\u6253\u5f00\u547d\u4ee4\u884c\u7ec8\u7aef\u3002<\/li>\n<li>\u4f7f\u7528\u7ba1\u9053\u7b26\u53f7 | \u5c06 tar \u6587\u4ef6\u7684\u5185\u5bb9\u4f20\u9012\u7ed9 docker load \u547d\u4ee4\u3002\u4f8b\u5982\uff1a<\/li>\n<\/ul>\n<pre>cat [\u955c\u50cf\u6587\u4ef6\u8def\u5f84] | docker load<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fd9\u5c06\u4ece tar \u6587\u4ef6\u4e2d\u5bfc\u5165\u955c\u50cf\u3002<\/p>\n<p><strong>\u5bfc\u5165\u540e\u64cd\u4f5c<\/strong><\/p>\n<p>\u5bfc\u5165\u955c\u50cf\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528 docker images \u547d\u4ee4\u67e5\u770b\u672c\u5730\u53ef\u7528\u955c\u50cf\uff1a<\/p>\n<pre>docker images<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u627e\u5230\u5bfc\u5165\u7684\u955c\u50cf\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528 docker run \u547d\u4ee4\u542f\u52a8\u5bb9\u5668\uff1a<\/p>\n<pre>docker run [\u955c\u50cf\u540d\u79f0]<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fd9\u5c06\u4f7f\u7528\u7ed9\u5b9a\u7684\u955c\u50cf\u521b\u5efa\u5e76\u542f\u52a8\u4e00\u4e2a\u5bb9\u5668\u3002<\/p>\n<\/blockquote>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u5bfc\u5165\u955c\u50cf\u6587\u4ef6\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\u6587\u4ef6\u7684\u4e24\u79cd\u5bfc\u5165\u65b9\u6cd5\uff1a\u76f4\u63a5\u5bfc\u5165\u955c\u50cf\u540d\u79f0\uff1adocker pull [\u955c\u50cf\u540d\u79f0]\u5bfc\u5165 tar \u5f52\u6863\u6587\u4ef6\uff1adocker load \u5982\u4f55\u5bfc\u5165 Docker \u955c\u50cf\u6587\u4ef6 \u5bfc\u5165\u955c\u50cf\u6587\u4ef6 \u5bfc\u5165 Docker \u955c\u50cf\u6587\u4ef6\u7684\u65b9\u6cd5\u6709\u4e24\u79cd\uff1a \u76f4\u63a5\u5bfc\u5165\u955c\u50cf\u540d\u79f0\uff1a\u5982\u679c\u955c\u50cf\u5df2\u5728 Docker \u4ed3\u5e93\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u76f4\u63a5\u5bfc\u5165\uff1a docker pull [\u955c\u50cf\u540d\u79f0] \u767b\u5f55\u540e\u590d\u5236 \u5bfc\u5165 tar \u5f52\u6863\u6587\u4ef6\uff1a\u5982\u679c\u955c\u50cf\u662f\u672c\u5730 tar \u5f52\u6863\u6587\u4ef6\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5bfc\u5165\uff1a docker load &lt; [\u955c\u50cf\u6587\u4ef6\u8def\u5f84] \u767b\u5f55\u540e\u590d\u5236 \u8be6\u7ec6\u6b65\u9aa4\uff1a 1. \u76f4\u63a5\u5bfc\u5165\u955c\u50cf\u540d\u79f0 \u6253\u5f00\u547d\u4ee4\u884c\u7ec8\u7aef\u3002 \u8fd0\u884c pull \u547d\u4ee4\uff0c\u540e\u8ddf\u8981\u5bfc\u5165\u7684\u955c\u50cf\u540d\u79f0\u3002\u4f8b\u5982\uff1a docker pull nginx \u767b\u5f55\u540e\u590d\u5236 \u8fd9\u5c06\u4ece Docker \u4ed3\u5e93\u4e2d\u62c9\u53d6 Nginx \u955c\u50cf\u5e76\u5c06\u5176\u5bfc\u5165\u672c\u5730\u3002 2. \u5bfc\u5165 tar \u5f52\u6863\u6587\u4ef6 \u5c06 tar \u5f52\u6863\u6587\u4ef6\u4fdd\u5b58\u5230\u672c\u5730\u3002 \u6253\u5f00\u547d\u4ee4\u884c\u7ec8\u7aef\u3002 [&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-18285","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/18285","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=18285"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/18285\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=18285"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=18285"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=18285"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}