{"id":116231,"date":"2026-10-20T23:56:33","date_gmt":"2026-10-20T15:56:33","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/116231.html"},"modified":"2026-10-20T23:56:33","modified_gmt":"2026-10-20T15:56:33","slug":"docker%e9%83%a8%e7%bd%b2%e5%ba%94%e7%94%a8%e5%85%a5%e9%97%a8%e6%95%99%e7%a8%8b%ef%bc%882026%e7%89%88%ef%bc%89%ef%bc%9a%e4%bb%8e%e5%ae%89%e8%a3%85%e5%88%b0%e4%b8%8a%e7%ba%bf%ef%bc%8c%e4%b8%80%e4%b8%aa","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/116231.html","title":{"rendered":"Docker\u90e8\u7f72\u5e94\u7528\u5165\u95e8\u6559\u7a0b\uff082026\u7248\uff09\uff1a\u4ece\u5b89\u88c5\u5230\u4e0a\u7ebf\uff0c\u4e00\u4e2a\u4f8b\u5b50\u8dd1\u901a\u5168\u6d41\u7a0b"},"content":{"rendered":"<h3>\u4e00\u3001\u5148\u7ed9\u7ed3\u8bba<\/h3>\n<ul>\n<li>Docker \u628a\u5e94\u7528\u548c\u5b83\u7684\u8fd0\u884c\u73af\u5883\u6253\u5305\u5728\u4e00\u8d77&#xff0c;\u6362\u4e2a\u673a\u5668\u4e5f\u80fd\u4e00\u952e\u8dd1\u8d77\u6765&#xff1b;<\/li>\n<li>\u5165\u95e8\u53ea\u9700\u8981\u638c\u63e1 6 \u4e2a\u547d\u4ee4&#xff1a;pull\u3001run\u3001ps\u3001logs\u3001exec\u3001stop&#xff1b;<\/li>\n<li>\u90e8\u7f72\u4e00\u4e2a\u5e94\u7528\u7684\u6807\u51c6\u59ff\u52bf&#xff1a;\u5199 Dockerfile \u2192 \u6784\u5efa\u955c\u50cf \u2192 \u8dd1\u5bb9\u5668 \u2192 \u6302\u6570\u636e\u5377 \u2192 \u6620\u5c04\u7aef\u53e3&#xff1b;<\/li>\n<li>\u65b0\u624b\u6700\u5927\u7684\u4e24\u4e2a\u5751&#xff1a;\u5bb9\u5668\u4e00\u91cd\u542f\u6570\u636e\u5c31\u4e22\u3001\u7aef\u53e3\u88ab\u5360\u7528\u8d77\u4e0d\u6765\u2014\u2014\u672c\u6587\u90fd\u4f1a\u8bb2\u5230&#xff1b;<\/li>\n<li>\u6709\u670d\u52a1\u5668\u540e\u88c5\u4e2a Docker&#xff0c;\u4e2a\u4eba\u535a\u5ba2\u3001\u7b14\u8bb0\u3001\u56fe\u5e8a\u8fd9\u7c7b\u5c0f\u5e94\u7528\u90fd\u80fd\u7528\u5b83\u6258\u7ba1\u3002<\/li>\n<\/ul>\n<h3>\u4e8c\u3001Docker \u5230\u5e95\u89e3\u51b3\u4e86\u4ec0\u4e48\u95ee\u9898<\/h3>\n<p>\u4f20\u7edf\u90e8\u7f72\u6d41\u7a0b\u662f\u8fd9\u6837\u7684&#xff1a;\u4e70\u670d\u52a1\u5668 \u2192 \u88c5\u73af\u5883&#xff08;Python\/Node\/\u6570\u636e\u5e93&#xff09;\u2192 \u4f20\u4ee3\u7801 \u2192 \u624b\u52a8\u542f\u52a8\u3002\u73af\u5883\u88c5\u4e00\u534a\u3001\u7248\u672c\u5bf9\u4e0d\u4e0a\u3001\u6362\u53f0\u673a\u5668\u91cd\u6765\u4e00\u904d&#xff0c;\u662f\u5bb6\u5e38\u4fbf\u996d\u3002<\/p>\n<p>Docker \u7684\u601d\u8def\u662f&#xff1a;\u628a&#034;\u4ee3\u7801 &#043; \u8fd0\u884c\u73af\u5883&#034;\u6253\u5305\u6210\u4e00\u4e2a\u955c\u50cf&#xff0c;\u955c\u50cf\u542f\u52a8\u5c31\u662f\u5bb9\u5668\u3002\u5bb9\u5668\u91cc\u7684\u73af\u5883\u548c\u5f00\u53d1\u65f6\u5b8c\u5168\u4e00\u81f4&#xff0c;\u6362\u673a\u5668\u4e5f\u53ea\u662f&#034;\u62c9\u955c\u50cf \u2192 \u8dd1\u8d77\u6765&#034;\u4e24\u6b65\u3002<\/p>\n<p>\u4e00\u53e5\u8bdd\u7c7b\u6bd4&#xff1a;\u4ee5\u524d\u642c\u5bb6\u8981\u91cd\u65b0\u88c5\u4fee&#xff0c;Docker \u662f\u8fde\u5bb6\u5177\u4e00\u8d77\u642c\u3002<\/p>\n<h3>\u4e09\u3001\u5b89\u88c5 Docker&#xff08;\u4e09\u6b65&#xff09;<\/h3>\n<p>\u4ee5\u5e38\u89c1\u7684 Linux \u670d\u52a1\u5668\u4e3a\u4f8b&#xff08;CentOS \/ Ubuntu \u901a\u7528\u903b\u8f91&#xff09;&#xff1a;<\/p>\n<li>\u66f4\u65b0\u7cfb\u7edf\u5305\u7d22\u5f15&#xff1a;<span class=\"token function\">sudo<\/span> <span class=\"token function\">apt<\/span> update\n<\/li>\n<li>\u5b89\u88c5 Docker \u5f15\u64ce&#xff08;\u5b89\u88c5\u5305\u6765\u81ea\u5b98\u65b9\u6e90&#xff0c;\u88c5\u5b8c\u81ea\u52a8\u6ce8\u518c\u4e3a\u7cfb\u7edf\u670d\u52a1&#xff09;&#xff1a;<span class=\"token function\">curl<\/span> <span class=\"token parameter variable\">-fsSL<\/span> https:\/\/get.docker.com <span class=\"token operator\">|<\/span> <span class=\"token function\">sh<\/span>\n<\/li>\n<li>\u9a8c\u8bc1\u5b89\u88c5&#xff1a;<span class=\"token function\">sudo<\/span> <span class=\"token function\">docker<\/span> version\n<p>\u80fd\u770b\u5230 client \u548c server \u4e24\u6bb5\u7248\u672c\u53f7&#xff0c;\u8bf4\u660e\u5b89\u88c5\u6210\u529f\u3002server \u6bb5\u6709\u8f93\u51fa\u624d\u662f\u771f\u7684\u88c5\u597d\u4e86&#xff0c;\u53ea\u6709 client \u8bf4\u660e\u670d\u52a1\u6ca1\u8d77\u6765&#xff0c;\u5148 sudo systemctl start docker\u3002<\/li>\n<p>\u56fd\u5185\u670d\u52a1\u5668\u62c9\u955c\u50cf\u6162\u662f\u6b63\u5e38\u73b0\u8c61&#xff0c;\u53ef\u914d\u7f6e\u955c\u50cf\u52a0\u901f\u5668&#xff08;\u5404\u4e91\u5382\u5546\u63a7\u5236\u53f0\u90fd\u6709\u8bf4\u660e&#xff0c;\u6216\u53c2\u8003 Docker \u5b98\u65b9\u6587\u6863\u7684 registry mirrors \u914d\u7f6e&#xff09;\u3002<\/p>\n<h3>\u56db\u30016 \u4e2a\u5fc5\u4f1a\u7684\u547d\u4ee4<\/h3>\n<table>\n<tr>\u547d\u4ee4\u4f5c\u7528\u793a\u4f8b<\/tr>\n<tbody>\n<tr>\n<td>docker pull &lt;\u955c\u50cf\u540d&gt;<\/td>\n<td>\u62c9\u53d6\u955c\u50cf<\/td>\n<td>docker pull nginx<\/td>\n<\/tr>\n<tr>\n<td>docker run -d &#8211;name web -p 8080:80 nginx<\/td>\n<td>\u540e\u53f0\u542f\u52a8\u5bb9\u5668<\/td>\n<td>\u628a\u5bb9\u5668 80 \u7aef\u53e3\u6620\u5c04\u5230\u4e3b\u673a 8080<\/td>\n<\/tr>\n<tr>\n<td>docker ps<\/td>\n<td>\u67e5\u770b\u8fd0\u884c\u4e2d\u7684\u5bb9\u5668<\/td>\n<td>\u52a0 -a \u770b\u6240\u6709&#xff08;\u542b\u5df2\u505c\u6b62&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>docker logs -f web<\/td>\n<td>\u770b\u5bb9\u5668\u65e5\u5fd7<\/td>\n<td>\u6392\u67e5\u542f\u52a8\u5931\u8d25\u9996\u9009<\/td>\n<\/tr>\n<tr>\n<td>docker exec -it web bash<\/td>\n<td>\u8fdb\u5bb9\u5668\u5185\u90e8<\/td>\n<td>\u76f8\u5f53\u4e8e&#034;\u8fdc\u7a0b\u8fdb\u5230\u5bb9\u5668\u91cc&#034;<\/td>\n<\/tr>\n<tr>\n<td>docker stop web<\/td>\n<td>\u505c\u6b62\u5bb9\u5668<\/td>\n<td>\u5220\u6389\u7528 docker rm web<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8bb0\u4e0d\u4f4f\u6ca1\u5173\u7cfb&#xff0c;\u628a\u4e0a\u9762 6 \u4e2a\u6253\u5370\u51fa\u6765\u8d34\u663e\u793a\u5668\u65c1\u8fb9&#xff0c;\u524d\u4e24\u5468\u591f\u7528\u4e86\u3002<\/p>\n<h3>\u4e94\u3001\u90e8\u7f72\u7b2c\u4e00\u4e2a\u5e94\u7528&#xff1a;\u5b8c\u6574\u6d41\u7a0b<\/h3>\n<p>\u7528\u4e00\u4e2a\u9759\u6001\u7f51\u7ad9&#xff08;Nginx&#xff09;\u505a\u4f8b\u5b50&#xff0c;\u8d70\u901a&#034;\u955c\u50cf \u2192 \u5bb9\u5668 \u2192 \u7aef\u53e3&#034;\u5168\u94fe\u8def&#xff1a;<\/p>\n<p>\u7b2c 1 \u6b65&#xff1a;\u62c9\u955c\u50cf<\/p>\n<p><span class=\"token function\">docker<\/span> pull nginx<\/p>\n<p>\u7b2c 2 \u6b65&#xff1a;\u5199\u4e00\u4e2a\u6700\u7b80\u5355\u7684\u9875\u9762<br \/>\n\u65b0\u5efa index.html&#xff1a;<\/p>\n<p><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>h1<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>Hello Docker<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>h1<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><\/p>\n<p>\u7b2c 3 \u6b65&#xff1a;\u7528 Dockerfile \u544a\u8bc9 Docker \u600e\u4e48\u6253\u5305<br \/>\n\u540c\u76ee\u5f55\u65b0\u5efa Dockerfile&#xff1a;<\/p>\n<p>FROM nginx<br \/>\nCOPY index.html \/usr\/share\/nginx\/html\/<\/p>\n<p>\u4e24\u884c\u5c31\u591f\u4e86&#xff1a;\u57fa\u4e8e nginx \u955c\u50cf&#xff0c;\u628a\u9875\u9762\u62f7\u8fdb\u5b83\u9ed8\u8ba4\u7684\u7ad9\u70b9\u76ee\u5f55\u3002<\/p>\n<p>\u7b2c 4 \u6b65&#xff1a;\u6784\u5efa\u955c\u50cf<\/p>\n<p><span class=\"token function\">docker<\/span> build <span class=\"token parameter variable\">-t<\/span> my-site <span class=\"token builtin class-name\">.<\/span><\/p>\n<p>-t my-site \u662f\u7ed9\u955c\u50cf\u8d77\u540d&#xff0c;\u6700\u540e\u7684 . \u8868\u793a\u7528\u5f53\u524d\u76ee\u5f55\u7684 Dockerfile\u3002<\/p>\n<p>\u7b2c 5 \u6b65&#xff1a;\u542f\u52a8\u5bb9\u5668<\/p>\n<p><span class=\"token function\">docker<\/span> run <span class=\"token parameter variable\">-d<\/span> <span class=\"token parameter variable\">&#8211;name<\/span> my-site <span class=\"token parameter variable\">-p<\/span> <span class=\"token number\">8080<\/span>:80 my-site<\/p>\n<p>\u8bbf\u95ee http:\/\/\u670d\u52a1\u5668IP:8080&#xff0c;\u80fd\u770b\u5230 Hello Docker&#xff0c;\u7b2c\u4e00\u4e2a\u5e94\u7528\u5c31\u4e0a\u7ebf\u4e86\u3002<\/p>\n<h3>\u516d\u3001\u65b0\u624b\u5fc5\u8e29\u7684\u4e24\u4e2a\u5751&#xff08;\u63d0\u524d\u907f\u5f00&#xff09;<\/h3>\n<p>\u5751 1&#xff1a;\u5bb9\u5668\u4e00\u505c&#xff0c;\u6570\u636e\u5168\u6ca1\u4e86<\/p>\n<p>\u5bb9\u5668\u662f&#034;\u7528\u5b8c\u5373\u5f03&#034;\u7684\u8bbe\u8ba1&#xff0c;\u4f60\u5199\u8fdb\u5bb9\u5668\u91cc\u7684\u6587\u4ef6&#xff0c;\u5bb9\u5668\u4e00\u5220\u5c31\u6ca1\u4e86\u3002\u89e3\u51b3\u65b9\u6848\u662f\u6302\u6570\u636e\u5377&#xff1a;<\/p>\n<p><span class=\"token function\">docker<\/span> run <span class=\"token parameter variable\">-d<\/span> <span class=\"token parameter variable\">&#8211;name<\/span> my-site <span class=\"token parameter variable\">-p<\/span> <span class=\"token number\">8080<\/span>:80 <span class=\"token punctuation\">\\\\<\/span><br \/>\n  <span class=\"token parameter variable\">-v<\/span> \/data\/my-site:\/usr\/share\/nginx\/html <span class=\"token punctuation\">\\\\<\/span><br \/>\n  my-site<\/p>\n<p>-v \u4e3b\u673a\u76ee\u5f55:\u5bb9\u5668\u76ee\u5f55 \u628a\u4e3b\u673a\u7684 \/data\/my-site \u76ee\u5f55\u6620\u5c04\u8fdb\u5bb9\u5668&#xff0c;\u6587\u4ef6\u5199\u5728\u4e3b\u673a\u4e0a&#xff0c;\u5bb9\u5668\u5220\u4e86\u6570\u636e\u8fd8\u5728\u3002\u4efb\u4f55\u6709\u72b6\u6001\u7684\u5e94\u7528&#xff08;\u6570\u636e\u5e93\u3001\u535a\u5ba2\u3001\u7b14\u8bb0&#xff09;\u90fd\u8981\u6302\u6570\u636e\u5377&#xff0c;\u8fd9\u662f\u6700\u91cd\u8981\u7684\u4e00\u4e2a\u4e60\u60ef\u3002<\/p>\n<p>\u5751 2&#xff1a;\u7aef\u53e3\u88ab\u5360\u7528<\/p>\n<p>docker run \u62a5 port is already allocated&#xff0c;\u8bf4\u660e 8080 \u88ab\u522b\u7684\u8fdb\u7a0b\u5360\u4e86\u3002\u5148\u67e5\u5360\u7528&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">lsof<\/span> <span class=\"token parameter variable\">-i<\/span> :8080<\/p>\n<p>\u6362\u4e00\u4e2a\u7aef\u53e3&#xff08;\u6bd4\u5982 9090&#xff09;&#xff0c;\u6216\u8005\u505c\u6389\u5360\u7528\u5b83\u7684\u8fdb\u7a0b\u518d\u91cd\u6765\u3002<\/p>\n<h3>\u4e03\u3001\u90e8\u7f72\u5e26\u6570\u636e\u5e93\u7684\u5e94\u7528&#xff08;\u8fdb\u9636\u6a21\u677f&#xff09;<\/h3>\n<p>\u9759\u6001\u7ad9\u53ea\u662f\u70ed\u8eab&#xff0c;\u591a\u6570\u5e94\u7528\u662f&#034;\u5e94\u7528 &#043; \u6570\u636e\u5e93&#034;\u4e24\u4e2a\u5bb9\u5668\u3002\u4ee5\u5e38\u89c1\u7684&#034;\u7b14\u8bb0\u7c7b \/ \u535a\u5ba2\u7c7b&#034;\u5e94\u7528\u4e3a\u4f8b&#xff0c;\u6807\u51c6\u59ff\u52bf\u662f\u7528 docker-compose \u4e00\u6b21\u62c9\u8d77\u4e24\u4e2a\u670d\u52a1&#xff1a;<\/p>\n<p><span class=\"token comment\"># docker-compose.yml<\/span><br \/>\n<span class=\"token key atrule\">services<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">app<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">image<\/span><span class=\"token punctuation\">:<\/span> my<span class=\"token punctuation\">&#8211;<\/span>app<br \/>\n    <span class=\"token key atrule\">ports<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token string\">&#034;8080:80&#034;<\/span><br \/>\n    <span class=\"token key atrule\">volumes<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> .\/app<span class=\"token punctuation\">&#8211;<\/span>data<span class=\"token punctuation\">:<\/span>\/app\/data<br \/>\n  <span class=\"token key atrule\">db<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">image<\/span><span class=\"token punctuation\">:<\/span> mysql<span class=\"token punctuation\">:<\/span><span class=\"token number\">8<\/span><br \/>\n    <span class=\"token key atrule\">environment<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token key atrule\">MYSQL_ROOT_PASSWORD<\/span><span class=\"token punctuation\">:<\/span> yourpassword<br \/>\n    <span class=\"token key atrule\">volumes<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> .\/db<span class=\"token punctuation\">&#8211;<\/span>data<span class=\"token punctuation\">:<\/span>\/var\/lib\/mysql<\/p>\n<p>\u542f\u52a8&#xff1a;<\/p>\n<p><span class=\"token function\">docker<\/span> compose up <span class=\"token parameter variable\">-d<\/span><\/p>\n<p>\u4e24\u4e2a\u5bb9\u5668\u4e00\u8d77\u8d77\u6765&#xff0c;\u6570\u636e\u5206\u522b\u843d\u5728 app-data \u548c db-data \u4e24\u4e2a\u4e3b\u673a\u76ee\u5f55&#xff0c;\u5907\u4efd &#061; \u62f7\u8d1d\u8fd9\u4e24\u4e2a\u76ee\u5f55&#xff0c;\u6362\u673a\u5668 &#061; \u628a\u76ee\u5f55\u548c\u914d\u7f6e\u5e26\u8fc7\u53bb\u91cd\u65b0 up -d\u3002<\/p>\n<h3>\u516b\u3001\u5e38\u89c1\u95ee\u9898\u901f\u67e5<\/h3>\n<table>\n<tr>\u73b0\u8c61\u539f\u56e0\u5904\u7406<\/tr>\n<tbody>\n<tr>\n<td>docker ps \u6ca1\u6709\u5bb9\u5668\u4f46\u660e\u660e\u542f\u52a8\u4e86<\/td>\n<td>\u5bb9\u5668\u79d2\u9000\u4e86<\/td>\n<td>docker logs \u5bb9\u5668\u540d \u770b\u62a5\u9519<\/td>\n<\/tr>\n<tr>\n<td>\u8bbf\u95ee IP:\u7aef\u53e3 \u6253\u4e0d\u5f00<\/td>\n<td>\u7aef\u53e3\u6ca1\u6620\u5c04 \/ \u9632\u706b\u5899\u6ca1\u653e\u884c<\/td>\n<td>\u68c0\u67e5 -p \u53c2\u6570&#xff1b;\u653e\u884c\u5bf9\u5e94\u7aef\u53e3<\/td>\n<\/tr>\n<tr>\n<td>\u62c9\u955c\u50cf\u8d85\u65f6<\/td>\n<td>\u7f51\u7edc\u5230\u5b98\u65b9\u6e90\u6162<\/td>\n<td>\u914d\u955c\u50cf\u52a0\u901f\u5668<\/td>\n<\/tr>\n<tr>\n<td>Permission denied<\/td>\n<td>\u5f53\u524d\u7528\u6237\u4e0d\u5728 docker \u7ec4<\/td>\n<td>sudo usermod -aG docker \u4f60\u7684\u7528\u6237\u540d \u540e\u91cd\u767b<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>\u4e5d\u3001\u884c\u52a8\u6e05\u5355<\/h3>\n<li>\u88c5 Docker&#xff08;\u5b98\u65b9\u811a\u672c\u4e00\u6761\u547d\u4ee4&#xff09;&#xff0c;docker version \u786e\u8ba4 server \u6bb5\u6b63\u5e38&#xff1b;<\/li>\n<li>\u5b66 6 \u4e2a\u5fc5\u4f1a\u547d\u4ee4&#xff0c;\u5148\u62ff Nginx \u8dd1\u901a\u7b2c\u4e00\u4e2a\u5bb9\u5668&#xff1b;<\/li>\n<li>\u4ece\u7b2c\u4e8c\u6b65\u8d77\u5c31\u517b\u6210\u6302\u6570\u636e\u5377\u7684\u4e60\u60ef&#xff0c;\u522b\u628a\u6570\u636e\u5199\u8fdb\u5bb9\u5668&#xff1b;<\/li>\n<li>\u6709\u72b6\u6001\u7684\u5e94\u7528\u7528 docker-compose \u7ba1\u7406&#xff0c;\u6570\u636e\u76ee\u5f55\u72ec\u7acb\u51fa\u6765\u65b9\u4fbf\u5907\u4efd\u8fc1\u79fb&#xff1b;<\/li>\n<li>\u9047\u5230\u95ee\u9898\u5148 docker logs&#xff0c;\u516b\u6210\u7b54\u6848\u90fd\u5728\u65e5\u5fd7\u91cc\u3002<\/li>\n<p>\u8bf4\u660e&#xff1a;\u672c\u6587\u4e3a Docker \u6280\u672f\u79d1\u666e&#xff0c;\u547d\u4ee4\u4e0e\u914d\u7f6e\u4ee5 Docker \u5b98\u65b9\u6587\u6863\u5f53\u671f\u7248\u672c\u4e3a\u51c6&#xff1b;\u5177\u4f53\u670d\u52a1\u5668\u73af\u5883\u5dee\u5f02\u8bf7\u4ee5\u4f60\u7684\u7cfb\u7edf\u53d1\u884c\u7248\u6587\u6863\u4e3a\u51c6\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u5148\u7ed9\u7ed3\u8bba<br \/>\nDocker \u628a\u5e94\u7528\u548c\u5b83\u7684\u8fd0\u884c\u73af\u5883\u6253\u5305\u5728\u4e00\u8d77&#xff0c;\u6362\u4e2a\u673a\u5668\u4e5f\u80fd\u4e00\u952e\u8dd1\u8d77\u6765&#xff1b;\u5165\u95e8\u53ea\u9700\u8981\u638c\u63e1 6 \u4e2a\u547d\u4ee4&#xff1a;pull\u3001run\u3001ps\u3001logs\u3001exec\u3001stop&#xff1b;\u90e8\u7f72\u4e00\u4e2a\u5e94\u7528\u7684\u6807\u51c6\u59ff\u52bf&#xff1a;\u5199 Dockerfile \u2192 \u6784\u5efa\u955c\u50cf \u2192 \u8dd1\u5bb9\u5668 \u2192 \u6302\u6570\u636e\u5377 \u2192 \u6620\u5c04\u7aef\u53e3&#xff1b;\u65b0\u624b\u6700\u5927\u7684\u4e24\u4e2a\u5751&#xff1a;\u5bb9\u5668\u4e00\u91cd\u542f\u6570\u636e\u5c31\u4e22\u3001\u7aef\u53e3\u88ab\u5360\u7528\u8d77\u4e0d\u6765\u2014\u2014\u672c\u6587\u90fd\u4f1a\u8bb2\u5230&#xff1b;\u6709\u670d\u52a1\u5668\u540e\u88c5\u4e2a Docke<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[27,121,44],"topic":[],"class_list":["post-116231","post","type-post","status-publish","format-standard","hentry","category-server","tag-docker","tag-121","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Docker\u90e8\u7f72\u5e94\u7528\u5165\u95e8\u6559\u7a0b\uff082026\u7248\uff09\uff1a\u4ece\u5b89\u88c5\u5230\u4e0a\u7ebf\uff0c\u4e00\u4e2a\u4f8b\u5b50\u8dd1\u901a\u5168\u6d41\u7a0b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/116231.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Docker\u90e8\u7f72\u5e94\u7528\u5165\u95e8\u6559\u7a0b\uff082026\u7248\uff09\uff1a\u4ece\u5b89\u88c5\u5230\u4e0a\u7ebf\uff0c\u4e00\u4e2a\u4f8b\u5b50\u8dd1\u901a\u5168\u6d41\u7a0b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4e00\u3001\u5148\u7ed9\u7ed3\u8bba Docker \u628a\u5e94\u7528\u548c\u5b83\u7684\u8fd0\u884c\u73af\u5883\u6253\u5305\u5728\u4e00\u8d77&#xff0c;\u6362\u4e2a\u673a\u5668\u4e5f\u80fd\u4e00\u952e\u8dd1\u8d77\u6765&#xff1b;\u5165\u95e8\u53ea\u9700\u8981\u638c\u63e1 6 \u4e2a\u547d\u4ee4&#xff1a;pull\u3001run\u3001ps\u3001logs\u3001exec\u3001stop&#xff1b;\u90e8\u7f72\u4e00\u4e2a\u5e94\u7528\u7684\u6807\u51c6\u59ff\u52bf&#xff1a;\u5199 Dockerfile \u2192 \u6784\u5efa\u955c\u50cf \u2192 \u8dd1\u5bb9\u5668 \u2192 \u6302\u6570\u636e\u5377 \u2192 \u6620\u5c04\u7aef\u53e3&#xff1b;\u65b0\u624b\u6700\u5927\u7684\u4e24\u4e2a\u5751&#xff1a;\u5bb9\u5668\u4e00\u91cd\u542f\u6570\u636e\u5c31\u4e22\u3001\u7aef\u53e3\u88ab\u5360\u7528\u8d77\u4e0d\u6765\u2014\u2014\u672c\u6587\u90fd\u4f1a\u8bb2\u5230&#xff1b;\u6709\u670d\u52a1\u5668\u540e\u88c5\u4e2a Docke\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/116231.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-20T15:56:33+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/116231.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/116231.html\",\"name\":\"Docker\u90e8\u7f72\u5e94\u7528\u5165\u95e8\u6559\u7a0b\uff082026\u7248\uff09\uff1a\u4ece\u5b89\u88c5\u5230\u4e0a\u7ebf\uff0c\u4e00\u4e2a\u4f8b\u5b50\u8dd1\u901a\u5168\u6d41\u7a0b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-10-20T15:56:33+00:00\",\"dateModified\":\"2026-10-20T15:56:33+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/116231.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/116231.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/116231.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Docker\u90e8\u7f72\u5e94\u7528\u5165\u95e8\u6559\u7a0b\uff082026\u7248\uff09\uff1a\u4ece\u5b89\u88c5\u5230\u4e0a\u7ebf\uff0c\u4e00\u4e2a\u4f8b\u5b50\u8dd1\u901a\u5168\u6d41\u7a0b\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Docker\u90e8\u7f72\u5e94\u7528\u5165\u95e8\u6559\u7a0b\uff082026\u7248\uff09\uff1a\u4ece\u5b89\u88c5\u5230\u4e0a\u7ebf\uff0c\u4e00\u4e2a\u4f8b\u5b50\u8dd1\u901a\u5168\u6d41\u7a0b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/116231.html","og_locale":"zh_CN","og_type":"article","og_title":"Docker\u90e8\u7f72\u5e94\u7528\u5165\u95e8\u6559\u7a0b\uff082026\u7248\uff09\uff1a\u4ece\u5b89\u88c5\u5230\u4e0a\u7ebf\uff0c\u4e00\u4e2a\u4f8b\u5b50\u8dd1\u901a\u5168\u6d41\u7a0b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4e00\u3001\u5148\u7ed9\u7ed3\u8bba Docker \u628a\u5e94\u7528\u548c\u5b83\u7684\u8fd0\u884c\u73af\u5883\u6253\u5305\u5728\u4e00\u8d77&#xff0c;\u6362\u4e2a\u673a\u5668\u4e5f\u80fd\u4e00\u952e\u8dd1\u8d77\u6765&#xff1b;\u5165\u95e8\u53ea\u9700\u8981\u638c\u63e1 6 \u4e2a\u547d\u4ee4&#xff1a;pull\u3001run\u3001ps\u3001logs\u3001exec\u3001stop&#xff1b;\u90e8\u7f72\u4e00\u4e2a\u5e94\u7528\u7684\u6807\u51c6\u59ff\u52bf&#xff1a;\u5199 Dockerfile \u2192 \u6784\u5efa\u955c\u50cf \u2192 \u8dd1\u5bb9\u5668 \u2192 \u6302\u6570\u636e\u5377 \u2192 \u6620\u5c04\u7aef\u53e3&#xff1b;\u65b0\u624b\u6700\u5927\u7684\u4e24\u4e2a\u5751&#xff1a;\u5bb9\u5668\u4e00\u91cd\u542f\u6570\u636e\u5c31\u4e22\u3001\u7aef\u53e3\u88ab\u5360\u7528\u8d77\u4e0d\u6765\u2014\u2014\u672c\u6587\u90fd\u4f1a\u8bb2\u5230&#xff1b;\u6709\u670d\u52a1\u5668\u540e\u88c5\u4e2a Docke","og_url":"https:\/\/www.wsisp.com\/helps\/116231.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-10-20T15:56:33+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/116231.html","url":"https:\/\/www.wsisp.com\/helps\/116231.html","name":"Docker\u90e8\u7f72\u5e94\u7528\u5165\u95e8\u6559\u7a0b\uff082026\u7248\uff09\uff1a\u4ece\u5b89\u88c5\u5230\u4e0a\u7ebf\uff0c\u4e00\u4e2a\u4f8b\u5b50\u8dd1\u901a\u5168\u6d41\u7a0b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-10-20T15:56:33+00:00","dateModified":"2026-10-20T15:56:33+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/116231.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/116231.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/116231.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Docker\u90e8\u7f72\u5e94\u7528\u5165\u95e8\u6559\u7a0b\uff082026\u7248\uff09\uff1a\u4ece\u5b89\u88c5\u5230\u4e0a\u7ebf\uff0c\u4e00\u4e2a\u4f8b\u5b50\u8dd1\u901a\u5168\u6d41\u7a0b"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/116231","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=116231"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/116231\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=116231"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=116231"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=116231"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=116231"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}