{"id":2228,"date":"2024-01-23T23:41:16","date_gmt":"2024-01-23T15:41:16","guid":{"rendered":"http:\/\/www.specialwu.com\/?p=2228"},"modified":"2024-01-24T01:51:15","modified_gmt":"2024-01-23T17:51:15","slug":"docker-%e7%9b%b8%e5%85%b3","status":"publish","type":"post","link":"http:\/\/www.specialwu.com\/?p=2228","title":{"rendered":"docker \u76f8\u5173"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_61 ez-toc-wrap-center counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title \" >\u76ee\u5f55<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #000000;color:#000000\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #000000;color:#000000\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"http:\/\/www.specialwu.com\/?p=2228\/#%E7%AE%80%E5%8D%95%E4%BA%86%E8%A7%A3docker\" title=\"\u7b80\u5355\u4e86\u89e3docker\">\u7b80\u5355\u4e86\u89e3docker<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"http:\/\/www.specialwu.com\/?p=2228\/#%E4%B8%80%E4%B8%AA%E7%AE%80%E5%8D%95%E7%9A%84%E7%A4%BA%E4%BE%8B\" title=\"\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\">\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"http:\/\/www.specialwu.com\/?p=2228\/#%E5%85%B6%E4%BB%96%E8%8A%82%E7%82%B9%E7%9A%84%E6%9C%BA%E5%99%A8%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8%E8%BF%99%E4%B8%AA%E9%95%9C%E5%83%8F\" title=\"\u5176\u4ed6\u8282\u70b9\u7684\u673a\u5668\u5982\u4f55\u4f7f\u7528\u8fd9\u4e2a\u955c\u50cf\">\u5176\u4ed6\u8282\u70b9\u7684\u673a\u5668\u5982\u4f55\u4f7f\u7528\u8fd9\u4e2a\u955c\u50cf<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h1><span class=\"ez-toc-section\" id=\"%E7%AE%80%E5%8D%95%E4%BA%86%E8%A7%A3docker\"><\/span>\u7b80\u5355\u4e86\u89e3docker<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<p>\u5982\u679c\u4f60\u6070\u597d\u6709\u591a\u53f0\u8bbe\u5907\uff0cwindows\u7535\u8111\uff0c\u672c\u5730\u642d\u5efa\u7684\u865a\u62df\u673a\uff0c\u4e91\u670d\u52a1\u5668\u751a\u81f3\u7535\u89c6\u76d2\u5b50\uff0c\u6216\u8005\u53eb\u751f\u4ea7\u73af\u5883\uff0c\u6d4b\u8bd5\u73af\u5883\uff0c\u5f00\u53d1\u73af\u5883\u3002\u5728\u6392\u67e5\u9519\u8bef\u7684\u65f6\u5019\uff0c\u6709\u4e00\u4e2a\u91cd\u8981\u7684\u601d\u60f3\uff0c<code>\u63a7\u5236\u53d8\u91cf\u6cd5<\/code>\uff0c\u5728\u4e0d\u540c\u5730\u65b9\u8dd1\u7684\u4ee3\u7801\uff0c\u4e00\u65e6\u51fa\u73b0\u62a5\u9519\u8d77\u7801\u4fdd\u8bc1\u4ed6\u4eec\u7684\u8fd0\u884c\u73af\u5883\u662f\u4e00\u81f4\u7684\uff0c\u8fd9\u662f\u5176\u4e00\uff0c\u5176\u4e8c\uff0c\u8d77\u624b\u5c31\u662f\u641e\u73af\u5883\uff0c\u4f60\u4e5f\u4e0d\u60f3\u6bcf\u53f0\u8bbe\u5907\u4e0a\u642d\u5efa\u73af\u5883\u7684\u52a8\u4f5c\u90fd\u505a\u4e00\u904d\uff0c\u6bd4\u5982\u6211\u5728\u4e91\u670d\u52a1\u5668\u4e0a\u642d\u5efa\u4e86\u4e00\u5957Linux\u73af\u5883\uff0c\u5728\u672c\u5730windows\u4e0a\u4e5f\u8981\u4fdd\u6301\u4e00\u6837\u7684\u73af\u5883\uff0c\u5c31\u53ef\u4ee5\u4e24\u4e2a\u7cfb\u7edf\u90fd\u5b89\u88c5docker\uff0c\u53ea\u9700<code>\u590d\u5236<\/code>\u8fc7\u6765\u5c31\u6267\u884c\u5c31\u80fd\u7528\u3002\u590d\u5236\u8fc7\u6765\u7684\u4e1c\u897f\u5c31\u662f\u955c\u50cf\uff0c\u5728\u8dd1\u8d77\u6765\u7684\u955c\u50cf\u5c31\u53eb\u505a\u5bb9\u5668\uff0c\u955c\u50cf\u66f4\u50cf\u662f\u98df\u6750\uff0c\u4e0d\u8bba\u8c01\u505a\u7684\u83dc\u7aef\u4e0a\u6765\u603b\u5f52\u80fd\u5403\u5c31\u884c\uff0c\u80fd\u5403\u7684\u8fd9\u4e2a\u5c31\u770b\u4f5c\u662f\u5bb9\u5668\u3002<br \/>\n\u63a5\u4e0b\u6765\u7684\u64cd\u4f5c\u53ef\u80fd\u8981\u7406\u6e05\u4e00\u4e9b\u4e1c\u897f\uff0c\u8dd1\u955c\u50cf\u7684\u8fd9\u53f0\u673a\u5668\uff0c\u53eb\u5bbf\u4e3b\u673a\u3002<br \/>\n\u5bbf\u4e3b\u673a\u548c\u5bb9\u5668\u7684\u7f51\u7edc\u5173\u7cfb\uff08\u6b64\u5bbf\u4e3b\u673a\u4e3awindows\u7cfb\u7edf\uff09<\/p>\n<pre><code class=\"language-bash line-numbers\">C:\\Users\\specialwu3&gt;ipconfig\n\nWindows IP \u914d\u7f6e\n\n\u65e0\u7ebf\u5c40\u57df\u7f51\u9002\u914d\u5668 WLAN:\n\n   \u8fde\u63a5\u7279\u5b9a\u7684 DNS \u540e\u7f00 . . . . . . . :\n   IPv4 \u5730\u5740 . . . . . . . . . . . . : 192.168.1.9\n   \u5b50\u7f51\u63a9\u7801  . . . . . . . . . . . . : 255.255.255.0\n   \u9ed8\u8ba4\u7f51\u5173. . . . . . . . . . . . . : 192.168.1.1\n\n<\/code><\/pre>\n<ul>\n<li>\u5728\u5bb9\u5668\u4e2d\u7684IP<\/li>\n<\/ul>\n<pre><code class=\"language-bash line-numbers\">[root@1858af0f30e5 \/]# cat \/etc\/hosts\n127.0.0.1       localhost\n::1     localhost ip6-localhost ip6-loopback\nfe00::0 ip6-localnet\nff00::0 ip6-mcastprefix\nff02::1 ip6-allnodes\nff02::2 ip6-allrouters\n172.17.0.2      1858af0f30e5\n<\/code><\/pre>\n<p>\u5bb9\u5668\u548c\u865a\u62df\u673a<br \/>\n&#8211; \u5b98\u7f51\u7ed9\u7684\u89e3\u91ca<\/p>\n<pre><code class=\"language-bash line-numbers\">Docker is an open platform for developing, shipping, and running applications. \nDocker enables you to separate your applications from your infrastructure so you can deliver software quickly. \nWith Docker, you can manage your infrastructure in the same ways you manage your applications. \nBy taking advantage of Docker's methodologies for shipping, testing, and deploying code, \nyou can significantly reduce the delay between writing code and running it in production.\nDocker\u662f\u4e00\u4e2a\u7528\u4e8e\u5f00\u53d1\u3001\u90e8\u7f72\u548c\u8fd0\u884c\u5e94\u7528\u7a0b\u5e8f\u7684\u5f00\u653e\u5e73\u53f0\u3002\nDocker\u4f7f\u4f60\u80fd\u591f\u5c06\u5e94\u7528\u7a0b\u5e8f\u4e0e\u57fa\u7840\u8bbe\u65bd\u5206\u79bb\uff0c\u4ece\u800c\u53ef\u4ee5\u5feb\u901f\u4ea4\u4ed8\u8f6f\u4ef6\u3002\n\u901a\u8fc7Docker\uff0c\u4f60\u53ef\u4ee5\u4ee5\u4e0e\u7ba1\u7406\u5e94\u7528\u7a0b\u5e8f\u76f8\u540c\u7684\u65b9\u5f0f\u7ba1\u7406\u57fa\u7840\u8bbe\u65bd\u3002\n\u901a\u8fc7\u5229\u7528Docker\u7684\u4ee3\u7801\u4ea4\u4ed8\u3001\u6d4b\u8bd5\u548c\u90e8\u7f72\u65b9\u6cd5\uff0c\n\u4f60\u53ef\u4ee5\u5927\u5927\u7f29\u77ed\u7f16\u5199\u4ee3\u7801\u548c\u5728\u751f\u4ea7\u73af\u5883\u4e2d\u8fd0\u884c\u4ee3\u7801\u4e4b\u95f4\u7684\u5ef6\u8fdf\u3002\n<\/code><\/pre>\n<h1><span class=\"ez-toc-section\" id=\"%E4%B8%80%E4%B8%AA%E7%AE%80%E5%8D%95%E7%9A%84%E7%A4%BA%E4%BE%8B\"><\/span>\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<ul>\n<li>\u5728Linux\u4e0a\u5b89\u88c5docker (\u540c\u7406\u5728windows\u7cfb\u7edf\u4e0a\u5b89\u88c5docker-desk\u4e3a\u53e6\u4e00\u79cd\u65b9\u5f0f)<\/li>\n<\/ul>\n<pre><code class=\"language-bash line-numbers\">yum-config-manager --add-repo http:\/\/mirrors.aliyun.com\/docker-ce\/linux\/centos\/docker-ce.repo\nyum install -y docker-ce\n<\/code><\/pre>\n<ul>\n<li>\u62c9\u53d6\u955c\u50cf (\u901a\u5e38\u62c9\u53d6\u8fd9\u4e2a\u955c\u50cf\u6d4b\u8bd5docker\u662f\u5426\u5b89\u88c5\u5230\u4f4d)<\/li>\n<\/ul>\n<pre><code class=\"language-bash line-numbers\">[root@specialwu3 ~]# docker pull hello-world\n[root@specialwu3 ~]# docker run hello-world\nHello from Docker!\n...\n<\/code><\/pre>\n<ul>\n<li>\u67e5\u770b\u955c\u50cf<\/li>\n<\/ul>\n<pre><code class=\"language-bash line-numbers\">[root@specialwu3 ~]# docker images\nREPOSITORY            TAG       IMAGE ID       CREATED          SIZE\nhello-world           latest    feb5d9fea6a5   2 years ago      13.3kB\n<\/code><\/pre>\n<ul>\n<li>\u5236\u4f5c\u4e00\u4e2a\u7b80\u5355\u7684\u955c\u50cf<\/li>\n<\/ul>\n<ol>\n<li>\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>Dockerfile<\/code>\u7684\u6587\u4ef6 \u5728\u5f53\u524d\u76ee\u5f55\u4e2d\u6784\u5efa\u955c\u50cf\u5fc5\u987b\u6709\u7684<\/li>\n<\/ol>\n<pre><code class=\"language-bash line-numbers\"># FROM \u662f Dockerfile \u4e2d\u7684\u5173\u952e\u5b57\uff0c\u8868\u793a\u63a5\u4e0b\u6765\u8981\u6307\u5b9a\u4e00\u4e2a\u57fa\u7840\u955c\u50cf\n#alpine:latest\uff1aalpine \u662f\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u7684 Linux \u53d1\u884c\u7248\uff0clatest \u662f\u6807\u7b7e\uff08tag\uff09\uff0c\u8868\u793a\u4f7f\u7528\u8be5\u53d1\u884c\u7248\u7684\u6700\u65b0\u7248\u672c\n#alpine \u662f\u4e00\u4e2a\u7cbe\u7b80\u7684 Linux \u53d1\u884c\u7248\uff0c\u975e\u5e38\u9002\u5408\u7528\u4e8e\u6784\u5efa\u8f7b\u91cf\u7ea7\u548c\u5c0f\u578b\u7684 Docker \u955c\u50cf\u3002\nFROM alpine:latest\n\n# \u5728\u5bb9\u5668\u4e2d\u7684\u5de5\u4f5c\u76ee\u5f55 \/app\nWORKDIR \/app\n\n# \u5f53\u524d\u76ee\u5f55\u4e0b\u7684\u6587\u4ef6\u590d\u5236\u5230\u5bb9\u5668 app\u76ee\u5f55\u4e0b \/app\nCOPY . \/app\n\n# Define environment variable\nENV NAME specialwu\n\n# Run the command when the container starts\nCMD [\"sh\", \"-c\", \"echo Hello $NAME &amp;&amp; cat test.txt\"]\n<\/code><\/pre>\n<ol start=\"2\">\n<li>\u6784\u5efa\u955c\u50cf (-t \u6307\u5b9a\u955c\u50cf\u540d \u955c\u50cf\u6587\u4ef6\u6240\u5728\u8def\u5f84)<\/li>\n<\/ol>\n<pre><code class=\"language-bash line-numbers\">docker build -t hello-mytest \/opt\/makeimages\/\n<\/code><\/pre>\n<ol start=\"3\">\n<li>\u8fd0\u884c\u5bb9\u5668<\/li>\n<\/ol>\n<pre><code class=\"language-bash line-numbers\">[root@specialwu3 ~]# docker run hello-mytest\nHello specialwu\n\u5bbf\u4e3b\u673a\u4e0a\u7684\u6587\u4ef6\n<\/code><\/pre>\n<p><code>\u76ee\u5f55\u8bf4\u660e<\/code><\/p>\n<pre><code class=\"language-bash line-numbers\">[root@specialwu3 makeimages]# ll\ntotal 8\n-rw-r--r-- 1 root root 346 Jan 24 00:34 Dockerfile\n-rw-r--r-- 1 root root  22 Jan 24 00:26 test.txt\n[root@specialwu3 makeimages]# cat test.txt \n\u5bbf\u4e3b\u673a\u4e0a\u7684\u6587\u4ef6\n<\/code><\/pre>\n<h2><span class=\"ez-toc-section\" id=\"%E5%85%B6%E4%BB%96%E8%8A%82%E7%82%B9%E7%9A%84%E6%9C%BA%E5%99%A8%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8%E8%BF%99%E4%B8%AA%E9%95%9C%E5%83%8F\"><\/span>\u5176\u4ed6\u8282\u70b9\u7684\u673a\u5668\u5982\u4f55\u4f7f\u7528\u8fd9\u4e2a\u955c\u50cf<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u6709\u4e24\u79cd\u4ed3\u5e93\u9009\u62e9\uff0c\u516c\u5171\u4ed3\u5e93\u5b98\u65b9\u5730\u5740\uff08<code>hub.docker.com<\/code>\uff09\uff0c\u79c1\u6709\u4ed3\u5e93\uff0c\u672c\u6b21\u4f20\u5230\u516c\u6709\u4ed3\u5e93\uff0c\u5982\u679c\u4f60\u60f3\u8981\u4f7f\u7528\uff0c\u4e5f\u53ef\u76f4\u63a5\u62c9\u53d6<\/p>\n<pre><code class=\"language-bash line-numbers\">docker commit -m '\u7b2c\u4e00\u7248' -a 'specialwu' hello-mytest   dockertest:001\ndocker tag  bbb65ee4be77  specialwu\/dockertest:001\ndocker push specialwu\/dockertest:001\n\n\u901a\u8fc7 docker commit \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u955c\u50cf\uff0c\u57fa\u4e8e\u73b0\u6709\u5bb9\u5668\u7684\u72b6\u6001\uff0c\u5e76\u6dfb\u52a0\u4e86\u8bf4\u660e\u548c\u4f5c\u8005\u4fe1\u606f\u3002\n\u901a\u8fc7 docker tag \u4e3a\u8be5\u955c\u50cf\u6dfb\u52a0\u4e00\u4e2a\u65b0\u7684\u6807\u7b7e\u3002\n\u901a\u8fc7 docker pull \u4ece\u672c\u5730\u63a8\u5230\u8fdc\u7a0b\u4ed3\u5e93\u3002\n<\/code><\/pre>\n<ul>\n<li>\u62c9\u53d6<\/li>\n<\/ul>\n<pre><code class=\"language-bash line-numbers\">[root@specialwu3 ~]# docker pull specialwu\/dockertest:001\n001: Pulling from specialwu\/dockertest\nDigest: sha256:1ba296227d4f7c7a41d09a3415149b00afa4d77b1d0a8e024aa5c9d66f624952\nStatus: Image is up to date for specialwu\/dockertest:001\ndocker.io\/specialwu\/dockertest:001\n<\/code><\/pre>\n<blockquote><p>\n  \u5bb9\u5668\u91cc\u7684\u6587\u4ef6\u7cfb\u7edf\u548c\u5bbf\u4e3b\u673a\u6587\u4ef6\u7cfb\u7edf\u65f6\u9694\u79bb\u7684\uff0c\u5bb9\u5668\u8981\u8bfb\u53d6\u5bbf\u4e3b\u673a\u7684\u6587\u4ef6\u8981\u4e48\u9009\u62e9\u6587\u4ef6\u590d\u5236\u8fdb\u5bb9\u5668\uff0c\u8981\u4e48\u770b\u4e00\u770b\u6570\u636e\u5377\u7684\u6982\u5ff5\uff0c\u4f7f\u4e24\u4e2a\u6587\u4ef6\u7cfb\u7edf\u6253\u901a\n<\/p><\/blockquote>\n<pre><code class=\"language-bash line-numbers\">docker cp \/mnt\/specialwu2\/node-v20.10.0.tar.gz hello-mytest:\/opt\/\n<\/code><\/pre>\n<ul>\n<li>\u8fd0\u884c\u5bb9\u5668\u7684\u4e24\u79cd\u65b9\u5f0f<\/li>\n<\/ul>\n<ol>\n<li>\u4ea4\u4e92\u5f0f\u6267\u884c\u65b9\u5f0f<\/li>\n<\/ol>\n<pre><code class=\"language-bash line-numbers\">docker run -itd --name hello-mytest -p 66:61 --privileged=true hello-mytest:latest \/sbin\/init\n-itd\uff1a\u8fd9\u4e09\u4e2a\u9009\u9879\u5206\u522b\u8868\u793a\u4ee5\u4ea4\u4e92\u6a21\u5f0f\uff08-i\uff09\u3001\u5206\u79bb\u6a21\u5f0f\uff08-d\uff09\u542f\u52a8\u5bb9\u5668\uff0c\u5e76\u5206\u914d\u4e00\u4e2a\u4f2a\u7ec8\u7aef\u3002\u8fd9\u6837\u5bb9\u5668\u5c31\u4f1a\u5728\u540e\u53f0\u8fd0\u884c\uff0c\u5e76\u4e14\u4f60\u53ef\u4ee5\u8fdb\u5165\u5bb9\u5668\u7684\u4ea4\u4e92\u5f0f Shell\u3002\n--name hello-mytest\uff1a\u6307\u5b9a\u5bb9\u5668\u7684\u540d\u79f0\u4e3a hello-mytest\u3002\n-p 66:61\uff1a\u5c06\u5bb9\u5668\u7684\u7aef\u53e3 61 \u6620\u5c04\u5230\u4e3b\u673a\u7684\u7aef\u53e3 66\u3002\u8fd9\u6837\u53ef\u4ee5\u901a\u8fc7\u4e3b\u673a\u7684\u7aef\u53e3 66 \u8bbf\u95ee\u5bb9\u5668\u5185\u7684\u670d\u52a1\u3002\n--privileged=true\uff1a\u4ee5\u7279\u6743\u6a21\u5f0f\u8fd0\u884c\u5bb9\u5668\uff0c\u5373\u5177\u6709\u66f4\u9ad8\u7684\u6743\u9650\uff0c\u53ef\u4ee5\u6267\u884c\u4e00\u4e9b\u7279\u6743\u64cd\u4f5c\u3002\nhello-mytest:latest\uff1a\u6307\u5b9a\u8981\u8fd0\u884c\u7684\u955c\u50cf\u53ca\u5176\u6807\u7b7e\u3002\n\/sbin\/init\uff1a\u542f\u52a8\u5bb9\u5668\u65f6\u6267\u884c\u7684\u547d\u4ee4\uff0c\u901a\u5e38\u662f\u6307\u5b9a\u5bb9\u5668\u542f\u52a8\u7684\u8fdb\u7a0b\u3002\n\n[root@specialwu3 ~]# docker ps \nCONTAINER ID   IMAGE                     COMMAND        CREATED          STATUS          PORTS                                                                                                                                                                                                                                                                                                                                                                           NAMES\n722faf5bb5ab   hello-mytest:latest       \"\/bin\/sh\"      31 minutes ago   Up 31 minutes   0.0.0.0:66-&gt;61\/tcp, :::66-&gt;61\/tcp\n<\/code><\/pre>\n<p>\u7b80\u5355\u7406\u89e3\u4e3a\u8fdb\u5165\u5bb9\u5668\u4e2d<\/p>\n<pre><code class=\"language-bash line-numbers\">[root@specialwu3 ~]# docker exec -it hello-mytest \/bin\/sh\n\/app # cat test.txt\n\u5bbf\u4e3b\u673a\u4e0a\u7684\u6587\u4ef6\n\/app # \n<\/code><\/pre>\n<ol start=\"2\">\n<li>\u7b80\u5316\u65b9\u5f0f<\/li>\n<\/ol>\n<pre><code class=\"language-bash line-numbers\">docker run hello-mytest\n\u8fd9\u79cd\u65b9\u5f0f\u662f\u4e00\u4e2a\u7b80\u5316\u7684\u8fd0\u884c\u5bb9\u5668\u7684\u547d\u4ee4\uff0c\u5b83\u4f7f\u7528\u9ed8\u8ba4\u9009\u9879\uff0c\n\u4e0d\u6307\u5b9a\u989d\u5916\u7684\u53c2\u6570\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0cDocker \u5c06\u6309\u7167\u9ed8\u8ba4\u8bbe\u7f6e\u8fd0\u884c\u5bb9\u5668\uff0c\u4e0d\u4f1a\u4f7f\u7528\u4ea4\u4e92\u6a21\u5f0f\u3001\u4e0d\u4f1a\u6307\u5b9a\u5bb9\u5668\u540d\u79f0\u3001\u7aef\u53e3\u6620\u5c04\u7b49\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u7b80\u5355\u4e86\u89e3docker \u5982\u679c\u4f60\u6070\u597d\u6709\u591a\u53f0\u8bbe\u5907\uff0cwindows\u7535\u8111\uff0c\u672c\u5730\u642d\u5efa\u7684\u865a\u62df\u673a\uff0c\u4e91\u670d\u52a1\u5668\u751a\u81f3\u7535\u89c6\u76d2\u5b50\uff0c\u6216\u8005\u53eb [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2235,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[7],"tags":[],"_links":{"self":[{"href":"http:\/\/www.specialwu.com\/index.php?rest_route=\/wp\/v2\/posts\/2228"}],"collection":[{"href":"http:\/\/www.specialwu.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.specialwu.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.specialwu.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.specialwu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2228"}],"version-history":[{"count":5,"href":"http:\/\/www.specialwu.com\/index.php?rest_route=\/wp\/v2\/posts\/2228\/revisions"}],"predecessor-version":[{"id":2239,"href":"http:\/\/www.specialwu.com\/index.php?rest_route=\/wp\/v2\/posts\/2228\/revisions\/2239"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.specialwu.com\/index.php?rest_route=\/wp\/v2\/media\/2235"}],"wp:attachment":[{"href":"http:\/\/www.specialwu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2228"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.specialwu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2228"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.specialwu.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2228"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}