{"id":37355,"date":"2025-05-15T22:27:29","date_gmt":"2025-05-15T14:27:29","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/37355.html"},"modified":"2025-05-15T22:27:29","modified_gmt":"2025-05-15T14:27:29","slug":"%e3%80%8adocker-%e5%85%a5%e9%97%a8%e4%b8%8e%e8%bf%9b%e9%98%b6%ef%bc%9a%e6%9e%b6%e6%9e%84%e5%89%96%e6%9e%90%e3%80%81%e9%9a%94%e7%a6%bb%e5%8e%9f%e7%90%86%e5%8f%8a%e5%ae%89%e8%a3%85%e5%ae%9e%e6%93%8d","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/37355.html","title":{"rendered":"\u300aDocker \u5165\u95e8\u4e0e\u8fdb\u9636\uff1a\u67b6\u6784\u5256\u6790\u3001\u9694\u79bb\u539f\u7406\u53ca\u5b89\u88c5\u5b9e\u64cd\u300b"},"content":{"rendered":"<h2>1 docker \u7b80\u4ecb<\/h2>\n<h3>1.1 Docker \u7684\u4f18\u70b9<\/h3>\n<p>Docker \u662f\u4e00\u6b3e\u5f00\u653e\u5e73\u53f0&#xff0c;\u7528\u4e8e\u5e94\u7528\u7a0b\u5e8f\u7684\u5f00\u53d1\u3001\u4ea4\u4ed8\u4e0e\u8fd0\u884c&#xff0c;\u80fd\u5c06\u5e94\u7528\u548c\u57fa\u7840\u67b6\u6784\u5206\u79bb&#xff0c;\u5b9e\u73b0\u8f6f\u4ef6\u5feb\u901f\u4ea4\u4ed8 &#xff0c;\u8fd8\u80fd\u4ee5\u7edf\u4e00\u65b9\u5f0f\u7ba1\u7406\u5e94\u7528\u548c\u57fa\u7840\u67b6\u6784&#xff0c;\u7f29\u77ed\u4ee3\u7801\u4ece\u7f16\u5199\u5230\u4e0a\u7ebf\u7684\u65f6\u95f4\u3002\u5176\u6838\u5fc3\u4f18\u52bf\u5982\u4e0b&#xff1a;<\/p>\n<ul>\n<li>\u52a0\u901f\u5e94\u7528\u4ea4\u4ed8\u6d41\u7a0b&#xff1a;\u5f00\u53d1\u4eba\u5458\u53ef\u5728\u672c\u5730\u5bb9\u5668\u7684\u6807\u51c6\u5316\u73af\u5883\u7f16\u5199\u4ee3\u7801&#xff0c;\u8f7b\u677e\u4e0e\u540c\u4e8b\u5171\u4eab\u6210\u679c\u3002\u5e94\u7528\u80fd\u5feb\u901f\u63a8\u9001\u81f3\u6d4b\u8bd5\u73af\u5883\u5b8c\u6210\u81ea\u52a8\u6216\u624b\u52a8\u6d4b\u8bd5&#xff0c;\u53d1\u73b0\u95ee\u9898\u540e\u53ef\u53ca\u65f6\u4fee\u590d\u3001\u91cd\u65b0\u90e8\u7f72\u3002\u6d4b\u8bd5\u901a\u8fc7\u540e&#xff0c;\u66f4\u65b0\u7684\u955c\u50cf\u53ef\u4fbf\u6377\u63a8\u9001\u81f3\u751f\u4ea7\u73af\u5883&#xff0c;\u9002\u914d\u6301\u7eed\u96c6\u6210\u548c\u6301\u7eed\u4ea4\u4ed8\u6d41\u7a0b\u3002<\/li>\n<li>\u7075\u6d3b\u90e8\u7f72\u4e0e\u9ad8\u6548\u6269\u5c55&#xff1a;\u57fa\u4e8e\u5bb9\u5668\u7684 Docker&#xff0c;\u5de5\u4f5c\u8d1f\u8f7d\u5177\u5907\u9ad8\u79fb\u690d\u6027&#xff0c;\u80fd\u5728\u672c\u5730\u3001\u6570\u636e\u4e2d\u5fc3\u3001\u4e91\u670d\u52a1\u7b49\u591a\u73af\u5883\u8fd0\u884c\u3002\u51ed\u501f\u53ef\u79fb\u690d\u3001\u8f7b\u91cf\u7279\u6027&#xff0c;\u53ef\u6309\u9700\u5b9e\u65f6\u6269\u5c55\u6216\u7f29\u51cf\u5e94\u7528\u3001\u670d\u52a1\u89c4\u6a21\u3002<\/li>\n<li>\u63d0\u5347\u786c\u4ef6\u8d44\u6e90\u5229\u7528\u7387&#xff1a;Docker \u8f7b\u5de7\u5feb\u901f&#xff0c;\u76f8\u6bd4\u4f20\u7edf\u865a\u62df\u673a&#xff0c;\u662f\u66f4\u7ecf\u6d4e\u9ad8\u6548\u7684\u9009\u62e9&#xff0c;\u80fd\u8ba9\u786c\u4ef6\u53d1\u6325\u66f4\u5927\u6548\u80fd&#xff0c;\u5c24\u5176\u9002\u7528\u4e8e\u9ad8\u5bc6\u5ea6\u53ca\u4e2d\u5c0f\u578b\u90e8\u7f72\u573a\u666f\u3002<\/li>\n<\/ul>\n<p>Docker\u548c\u865a\u62df\u673a&#xff08;VM&#xff09;\u867d\u7136\u90fd\u7528\u4e8e\u5b9e\u73b0\u8d44\u6e90\u9694\u79bb\u548c\u5e94\u7528\u7a0b\u5e8f\u7684\u72ec\u7acb\u8fd0\u884c&#xff0c;\u4f46\u5b83\u4eec\u5728\u6280\u672f\u67b6\u6784\u3001\u6027\u80fd\u7279\u5f81\u548c\u9002\u7528\u573a\u666f\u4e0a\u5b58\u5728\u663e\u8457\u5dee\u5f02\u3002\u4ee5\u4e0b\u662f\u4e24\u8005\u7684\u6838\u5fc3\u533a\u522b&#xff1a;<\/p>\n<p>\u603b\u7ed3\u5bf9\u6bd4\u8868<\/p>\n<table>\n<tr>\u7279\u6027Docker&#xff08;\u5bb9\u5668&#xff09;\u865a\u62df\u673a&#xff08;VM&#xff09;<\/tr>\n<tbody>\n<tr>\n<td>\u9694\u79bb\u7ea7\u522b<\/td>\n<td>\u8fdb\u7a0b\u7ea7&#xff08;\u5171\u4eab\u5185\u6838&#xff09;<\/td>\n<td>\u786c\u4ef6\u7ea7&#xff08;\u72ec\u7acb\u5185\u6838&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u542f\u52a8\u65f6\u95f4<\/td>\n<td>\u79d2\u7ea7<\/td>\n<td>\u5206\u949f\u7ea7<\/td>\n<\/tr>\n<tr>\n<td>\u8d44\u6e90\u5360\u7528<\/td>\n<td>\u4f4e&#xff08;\u4ec5\u9700\u5fc5\u8981\u4f9d\u8d56&#xff09;<\/td>\n<td>\u9ad8&#xff08;\u5b8c\u6574\u64cd\u4f5c\u7cfb\u7edf&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u6027\u80fd<\/td>\n<td>\u63a5\u8fd1\u539f\u751f<\/td>\n<td>\u6709Hypervisor\u5f00\u9500<\/td>\n<\/tr>\n<tr>\n<td>\u53ef\u79fb\u690d\u6027<\/td>\n<td>\u9ad8&#xff08;\u955c\u50cf\u6807\u51c6\u5316&#xff09;<\/td>\n<td>\u4e2d&#xff08;\u4f9d\u8d56Hypervisor&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u7ba1\u7406\u590d\u6742\u5ea6<\/td>\n<td>\u4f4e&#xff08;\u5bb9\u5668\u7f16\u6392\u5de5\u5177&#xff09;<\/td>\n<td>\u9ad8&#xff08;\u591aOS\u7ef4\u62a4&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u5b89\u5168\u6027<\/td>\n<td>\u4e2d\u7b49&#xff08;\u9700\u914d\u7f6e\u5b89\u5168\u7b56\u7565&#xff09;<\/td>\n<td>\u9ad8&#xff08;\u5b8c\u5168\u9694\u79bb&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u9002\u7528\u573a\u666f<\/td>\n<td>\u5fae\u670d\u52a1\u3001CI\/CD\u3001\u8f7b\u91cf\u7ea7\u5e94\u7528<\/td>\n<td>\u4f20\u7edf\u5e94\u7528\u3001\u591a\u79df\u6237\u3001\u5173\u952e\u7cfb\u7edf<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>\u9009\u62e9\u5efa\u8bae<\/h4>\n<ul>\n<li>\u4f18\u5148\u4f7f\u7528Docker&#xff1a;\u82e5\u8ffd\u6c42\u5feb\u901f\u90e8\u7f72\u3001\u8d44\u6e90\u6548\u7387\u548c\u5fae\u670d\u52a1\u67b6\u6784\u3002<\/li>\n<li>\u4f18\u5148\u4f7f\u7528VM&#xff1a;\u82e5\u9700\u8981\u5f3a\u9694\u79bb\u6027\u3001\u5f02\u6784\u73af\u5883\u652f\u6301\u6216\u4f20\u7edf\u5e94\u7528\u8fc1\u79fb\u3002<\/li>\n<\/ul>\n<h3>1.2 docker\u67b6\u6784<\/h3>\n<p>Docker \u67b6\u6784\u662f\u57fa\u4e8e\u5ba2\u6237\u7aef-\u670d\u52a1\u5668\u6a21\u5f0f\u7684&#xff0c;\u5176\u4e2d\u5305\u62ec\u591a\u4e2a\u5173\u952e\u7ec4\u4ef6&#xff0c;\u786e\u4fdd\u5bb9\u5668\u5316\u5e94\u7528\u7684\u9ad8\u6548\u6784\u5efa\u3001\u7ba1\u7406\u548c\u8fd0\u884c\u3002<\/p>\n<p>Docker \u7684\u67b6\u6784\u8bbe\u8ba1\u4f7f\u5f97\u5f00\u53d1\u8005\u80fd\u591f\u8f7b\u677e\u5730\u5c06\u5e94\u7528\u7a0b\u5e8f\u4e0e\u5176\u6240\u6709\u4f9d\u8d56\u5c01\u88c5\u5728\u4e00\u4e2a\u53ef\u79fb\u690d\u7684\u5bb9\u5668\u4e2d&#xff0c;\u5e76\u5728\u4e0d\u540c\u7684\u73af\u5883\u4e2d\u4e00\u81f4\u5730\u8fd0\u884c\u3002<\/p>\n<p>Docker \u4f7f\u7528\u5ba2\u6237\u7aef-\u670d\u52a1\u5668 (C\/S) \u67b6\u6784\u6a21\u5f0f&#xff0c;\u4f7f\u7528\u8fdc\u7a0b API \u6765\u7ba1\u7406\u548c\u521b\u5efa Docker \u5bb9\u5668\u3002<\/p>\n<p>Docker \u5bb9\u5668\u901a\u8fc7 Docker \u955c\u50cf\u6765\u521b\u5efa\u3002<\/p>\n<p>\u5bb9\u5668\u4e0e\u955c\u50cf\u7684\u5173\u7cfb\u7c7b\u4f3c\u4e8e\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u4e2d\u7684\u5bf9\u8c61\u4e0e\u7c7b\u3002<\/p>\n<p>\u7c7b\u4e0e\u955c\u50cf&#xff1a;\u5728\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u91cc&#xff0c;\u7c7b\u662f\u4e00\u79cd\u62bd\u8c61\u7684\u6a21\u677f&#xff0c;\u5b9a\u4e49\u4e86\u5bf9\u8c61\u6240\u5177\u6709\u7684\u5c5e\u6027\u548c\u65b9\u6cd5\u3002\u4f8b\u5982&#xff0c;\u5b9a\u4e49\u4e00\u4e2a \u201c\u6c7d\u8f66\u201d \u7c7b&#xff0c;\u5305\u542b\u54c1\u724c\u3001\u578b\u53f7\u3001\u901f\u5ea6\u7b49\u5c5e\u6027\u4ee5\u53ca\u542f\u52a8\u3001\u52a0\u901f\u3001\u5239\u8f66\u7b49\u65b9\u6cd5\u3002\u7c7b\u4f3c\u5730&#xff0c;Docker \u955c\u50cf\u4e5f\u662f\u4e00\u79cd\u6a21\u677f&#xff0c;\u5b83\u5305\u542b\u4e86\u8fd0\u884c\u5e94\u7528\u7a0b\u5e8f\u6240\u9700\u7684\u6240\u6709\u6587\u4ef6\u3001\u4f9d\u8d56\u9879\u3001\u914d\u7f6e\u7b49&#xff0c;\u662f\u4e00\u4e2a\u9759\u6001\u7684\u5b9e\u4f53\u3002\u6bd4\u5982\u4e00\u4e2a Python \u5e94\u7528\u7684\u955c\u50cf&#xff0c;\u4f1a\u5305\u542b Python \u89e3\u91ca\u5668\u3001\u5e94\u7528\u4ee3\u7801\u4ee5\u53ca\u76f8\u5173\u7684\u5e93\u7b49\u3002 \u5bf9\u8c61\u4e0e\u5bb9\u5668&#xff1a;\u5bf9\u8c61\u662f\u7c7b\u7684\u5b9e\u4f8b&#xff0c;\u57fa\u4e8e\u7c7b\u521b\u5efa\u51fa\u6765&#xff0c;\u5177\u6709\u5177\u4f53\u7684\u5c5e\u6027\u503c\u548c\u884c\u4e3a\u3002\u6bd4\u5982\u6839\u636e \u201c\u6c7d\u8f66\u201d \u7c7b\u521b\u5efa\u51fa\u4e00\u8f86\u5177\u4f53\u7684\u6c7d\u8f66\u5bf9\u8c61&#xff0c;\u6709\u7279\u5b9a\u7684\u54c1\u724c\u3001\u578b\u53f7\u7b49\u5c5e\u6027\u548c\u5b9e\u9645\u7684\u64cd\u4f5c\u884c\u4e3a\u3002Docker \u5bb9\u5668\u5219\u662f\u955c\u50cf\u7684\u8fd0\u884c\u5b9e\u4f8b&#xff0c;\u57fa\u4e8e\u955c\u50cf\u521b\u5efa\u3002\u5bb9\u5668\u5177\u6709\u52a8\u6001\u7684\u7279\u6027&#xff0c;\u5728\u8fd0\u884c\u65f6\u53ef\u4ee5\u5bf9\u5176\u8fdb\u884c\u542f\u52a8\u3001\u505c\u6b62\u3001\u6269\u5c55\u7b49\u64cd\u4f5c&#xff0c;\u5c31\u50cf\u4e00\u4e2a\u6b63\u5728\u884c\u9a76\u7684\u6c7d\u8f66\u5bf9\u8c61&#xff0c;\u800c\u955c\u50cf\u53ea\u662f\u4e00\u4e2a\u5236\u9020\u6c7d\u8f66\u7684\u84dd\u56fe\u3002 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250515142727-6825f9cfddbb6.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>Docker \u67b6\u6784\u7684\u5de5\u4f5c\u6d41\u7a0b \u6784\u5efa\u955c\u50cf&#xff1a;\u4f7f\u7528 Dockerfile \u521b\u5efa\u955c\u50cf\u3002 \u63a8\u9001\u955c\u50cf\u5230\u6ce8\u518c\u8868&#xff1a;\u5c06\u955c\u50cf\u4e0a\u4f20\u5230 Docker Hub \u6216\u79c1\u6709\u6ce8\u518c\u8868\u4e2d\u3002 \u62c9\u53d6\u955c\u50cf&#xff1a;\u901a\u8fc7 docker pull \u4ece\u6ce8\u518c\u8868\u4e2d\u62c9\u53d6\u955c\u50cf\u3002 \u8fd0\u884c\u5bb9\u5668&#xff1a;\u4f7f\u7528\u955c\u50cf\u521b\u5efa\u5e76\u542f\u52a8\u5bb9\u5668\u3002 \u7ba1\u7406\u5bb9\u5668&#xff1a;\u4f7f\u7528 Docker \u5ba2\u6237\u7aef\u547d\u4ee4\u7ba1\u7406\u6b63\u5728\u8fd0\u884c\u7684\u5bb9\u5668&#xff08;\u4f8b\u5982\u67e5\u770b\u65e5\u5fd7\u3001\u505c\u6b62\u5bb9\u5668\u3001\u67e5\u770b\u8d44\u6e90\u4f7f\u7528\u60c5\u51b5\u7b49&#xff09;\u3002 \u7f51\u7edc\u4e0e\u5b58\u50a8&#xff1a;\u5bb9\u5668\u4e4b\u95f4\u901a\u8fc7 Docker \u7f51\u7edc\u8fde\u63a5&#xff0c;\u6570\u636e\u901a\u8fc7 Docker \u5377\u6216\u7ed1\u5b9a\u6302\u8f7d\u8fdb\u884c\u6301\u4e45\u5316\u3002<\/p>\n<p>1. Docker \u5ba2\u6237\u7aef&#xff08;Docker Client&#xff09; Docker \u5ba2\u6237\u7aef\u5c31\u50cf\u662f\u7528\u6237\u4e0e Docker \u7cfb\u7edf\u6c9f\u901a\u7684\u201c\u9065\u63a7\u5668\u201d&#xff0c;\u5b83\u4ee5\u547d\u4ee4\u884c\u7684\u5f62\u5f0f\u5b58\u5728&#xff0c;\u8ba9\u7528\u6237\u80fd\u8f7b\u677e\u64cd\u63a7 Docker \u5404\u9879\u529f\u80fd\u3002\u5f53\u4f60\u5728\u547d\u4ee4\u884c\u8f93\u5165\u6307\u4ee4&#xff0c;\u6bd4\u5982\u521b\u5efa\u5bb9\u5668\u3001\u6784\u5efa\u955c\u50cf&#xff0c;\u8fd9\u4e9b\u6307\u4ee4\u5c31\u4f1a\u901a\u8fc7\u5ba2\u6237\u7aef\u53d1\u9001\u7ed9 Docker \u5b88\u62a4\u8fdb\u7a0b&#xff0c;\u7531\u5b88\u62a4\u8fdb\u7a0b\u53bb\u6267\u884c\u5177\u4f53\u64cd\u4f5c\u3002<\/p>\n<p>\u6838\u5fc3\u529f\u80fd&#xff1a;\u901a\u8fc7\u7b80\u5355\u7684\u547d\u4ee4\u5c31\u80fd\u5b9e\u73b0\u4e0e Docker \u5b88\u62a4\u8fdb\u7a0b\u7684\u4ea4\u4e92&#xff0c;\u5b8c\u6210\u5bb9\u5668\u521b\u5efa\u3001\u955c\u50cf\u6784\u5efa\u3001\u67e5\u770b\u5bb9\u5668\u72b6\u6001\u7b49\u4efb\u52a1 \u3002<\/p>\n<p>\u5e38\u7528\u6307\u4ee4\u53ca\u4f5c\u7528&#xff1a;<\/p>\n<ul>\n<li>docker run&#xff1a;\u57fa\u4e8e\u955c\u50cf\u5feb\u901f\u542f\u52a8\u4e00\u4e2a\u5bb9\u5668&#xff1b;<\/li>\n<li>docker ps&#xff1a;\u67e5\u770b\u5f53\u524d\u6b63\u5728\u8fd0\u884c\u7684\u5bb9\u5668\u5217\u8868&#xff1b;<\/li>\n<li>docker build&#xff1a;\u6839\u636e Dockerfile \u4e2d\u7684\u914d\u7f6e&#xff0c;\u751f\u6210\u5b9a\u5236\u5316\u7684 Docker \u955c\u50cf&#xff1b;<\/li>\n<li>docker exec&#xff1a;\u8fdb\u5165\u6b63\u5728\u8fd0\u884c\u7684\u5bb9\u5668\u5185\u90e8&#xff0c;\u6267\u884c\u7279\u5b9a\u547d\u4ee4\u3002<\/li>\n<\/ul>\n<li>Docker \u5b88\u62a4\u8fdb\u7a0b&#xff08;Docker Daemon&#xff09; Docker \u5b88\u62a4\u8fdb\u7a0b&#xff08;\u8fdb\u7a0b\u540d\u901a\u5e38\u4e3a dockerd&#xff09;\u662f Docker \u7cfb\u7edf\u7684\u201c\u5e55\u540e\u7ba1\u5bb6\u201d&#xff0c;\u8d1f\u8d23\u5904\u7406 Docker \u6700\u6838\u5fc3\u7684\u5de5\u4f5c&#xff0c;\u50cf\u7ba1\u7406\u5bb9\u5668\u4ece\u521b\u5efa\u5230\u9500\u6bc1\u7684\u6574\u4e2a\u751f\u547d\u5468\u671f\u3001\u6784\u5efa\u955c\u50cf\u3001\u5206\u53d1\u955c\u50cf\u7b49\u3002\u5b83\u5728\u540e\u53f0\u9ed8\u9ed8\u8fd0\u884c&#xff0c;\u6301\u7eed\u76d1\u542c Docker \u5ba2\u6237\u7aef\u53d1\u9001\u8fc7\u6765\u7684\u6307\u4ee4\u8bf7\u6c42&#xff0c;\u4e00\u65e6\u6536\u5230\u6307\u4ee4&#xff0c;\u5c31\u7acb\u5373\u5f00\u59cb\u6267\u884c\u76f8\u5173\u64cd\u4f5c\u3002<\/li>\n<p>\u542f\u52a8\u4e0e\u81ea\u542f\u52a8\u8bbe\u7f6e&#xff1a;\u5728\u5927\u591a\u6570\u60c5\u51b5\u4e0b&#xff0c;\u5b89\u88c5 Docker \u540e&#xff0c;\u5b88\u62a4\u8fdb\u7a0b\u4f1a\u81ea\u52a8\u542f\u52a8\u3002\u82e5\u9700\u624b\u52a8\u8bbe\u7f6e\u5f00\u673a\u81ea\u542f\u52a8&#xff08;\u9002\u7528\u4e8e\u4f7f\u7528 service \u521d\u59cb\u5316\u7cfb\u7edf\u7684\u573a\u666f&#xff09;&#xff0c;\u53ef\u4ee5\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> update-rc.d docker defaults<\/p>\n<p>\u8fd9\u6837\u6bcf\u6b21\u7cfb\u7edf\u542f\u52a8\u65f6&#xff0c;Docker \u5b88\u62a4\u8fdb\u7a0b\u4e5f\u4f1a\u81ea\u52a8\u8fd0\u884c&#xff0c;\u65e0\u9700\u624b\u52a8\u5f00\u542f\u3002<\/p>\n<p>3. Docker \u5f15\u64ce API&#xff08;Docker Engine API&#xff09; Docker \u5f15\u64ce API \u662f Docker \u5bf9\u5916\u5f00\u653e\u7684\u201c\u63a5\u53e3\u5927\u95e8\u201d&#xff0c;\u91c7\u7528 RESTful \u67b6\u6784\u8bbe\u8ba1&#xff0c;\u5916\u90e8\u5ba2\u6237\u7aef\u80fd\u901a\u8fc7\u5b83\u4e0e Docker \u5b88\u62a4\u8fdb\u7a0b\u8fdb\u884c\u901a\u4fe1\u3002\u501f\u52a9\u8fd9\u4e2a API&#xff0c;\u5f00\u53d1\u8005\u53ef\u4ee5\u4f7f\u7528 HTTP \u8bf7\u6c42\u7684\u65b9\u5f0f&#xff0c;\u5b9e\u73b0\u5bf9 Docker \u7684\u5404\u79cd\u64cd\u4f5c&#xff0c;\u5305\u62ec\u542f\u52a8\u5bb9\u5668\u3001\u6784\u5efa\u955c\u50cf\u3001\u67e5\u770b\u5bb9\u5668\u72b6\u6001\u7b49\u3002\u5b83\u6253\u7834\u4e86\u4e0d\u540c\u5e73\u53f0\u4e4b\u95f4\u7684\u9650\u5236&#xff0c;\u65e0\u8bba\u4f60\u4f7f\u7528\u54ea\u79cd\u7f16\u7a0b\u8bed\u8a00&#xff0c;\u53ea\u8981\u80fd\u53d1\u9001 HTTP \u8bf7\u6c42&#xff0c;\u5c31\u80fd\u5b9e\u73b0\u4e0e Docker \u7684\u4ea4\u4e92\u3002<\/p>\n<p>4. Docker \u5bb9\u5668&#xff08;Docker Containers&#xff09; Docker \u5bb9\u5668\u662f Docker \u6700\u6838\u5fc3\u7684\u201c\u4ea7\u54c1\u201d&#xff0c;\u5b83\u662f\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u3001\u53ef\u72ec\u7acb\u8fd0\u884c\u7684\u201c\u8f6f\u4ef6\u76d2\u5b50\u201d&#xff0c;\u91cc\u9762\u5c01\u88c5\u4e86\u8fd0\u884c\u5e94\u7528\u7a0b\u5e8f\u6240\u9700\u8981\u7684\u6240\u6709\u5185\u5bb9&#xff0c;\u4ece\u5e95\u5c42\u7684\u64cd\u4f5c\u7cfb\u7edf\u5e93\u5230\u5e94\u7528\u7a0b\u5e8f\u4ee3\u7801&#xff0c;\u4e00\u5e94\u4ff1\u5168\u3002\u5bb9\u5668\u8fd0\u884c\u65f6\u4f1a\u5171\u4eab\u5bbf\u4e3b\u673a\u7684\u64cd\u4f5c\u7cfb\u7edf\u5185\u6838&#xff0c;\u4f46\u5f7c\u6b64\u4e4b\u95f4\u7684\u6587\u4ef6\u7cfb\u7edf\u548c\u8fdb\u7a0b\u90fd\u662f\u76f8\u4e92\u9694\u79bb\u7684&#xff0c;\u5c31\u50cf\u4e00\u4e2a\u4e2a\u72ec\u7acb\u7684\u5c0f\u623f\u95f4&#xff0c;\u4e92\u4e0d\u5e72\u6270\u3002<\/p>\n<p>\u6838\u5fc3\u4f18\u52bf&#xff1a;<\/p>\n<ul>\n<li>\u73af\u5883\u4e00\u81f4\u6027&#xff1a;\u65e0\u8bba\u5728\u5f00\u53d1\u3001\u6d4b\u8bd5\u8fd8\u662f\u751f\u4ea7\u73af\u5883&#xff0c;\u53ea\u8981\u8fd0\u884c\u540c\u4e00\u4e2a\u5bb9\u5668&#xff0c;\u5e94\u7528\u7a0b\u5e8f\u7684\u8fd0\u884c\u6548\u679c\u90fd\u662f\u4e00\u6837\u7684&#xff1b;<\/li>\n<li>\u4e34\u65f6\u6027\u4e0e\u7075\u6d3b\u6027&#xff1a;\u5bb9\u5668\u751f\u547d\u5468\u671f\u77ed\u6682&#xff0c;\u4efb\u52a1\u5b8c\u6210\u540e\u53ef\u4ee5\u968f\u65f6\u9500\u6bc1&#xff0c;\u4e5f\u80fd\u5feb\u901f\u91cd\u65b0\u521b\u5efa&#xff1b;<\/li>\n<li>\u8de8\u5e73\u53f0\u6027&#xff1a;\u4e0d\u4f9d\u8d56\u5e95\u5c42\u64cd\u4f5c\u7cfb\u7edf\u914d\u7f6e&#xff0c;\u53ea\u8981\u6709 Docker \u73af\u5883&#xff0c;\u5c31\u80fd\u8fd0\u884c\u3002 \u4ee5\u4e0b\u662f\u9762\u5411\u521d\u5b66\u8005\u4f18\u5316\u540e\u7684 Docker \u6838\u5fc3\u6982\u5ff5\u89e3\u91ca&#xff0c;\u91c7\u7528\u7b80\u6d01\u6613\u61c2\u7684\u8bed\u8a00\u548c\u793a\u4f8b&#xff1a;<\/li>\n<\/ul>\n<p>5. Docker \u955c\u50cf&#xff08;Docker Images&#xff09; Docker \u955c\u50cf\u5c31\u50cf\u662f\u4e00\u4e2a\u201c\u8f6f\u4ef6\u5b89\u88c5\u5305\u201d&#xff0c;\u5b83\u662f\u5bb9\u5668\u7684\u53ea\u8bfb\u6a21\u677f&#xff0c;\u5305\u542b\u4e86\u5e94\u7528\u7a0b\u5e8f\u8fd0\u884c\u6240\u9700\u7684\u4e00\u5207&#xff1a;\u4ece\u64cd\u4f5c\u7cfb\u7edf\u3001\u8fd0\u884c\u65f6\u73af\u5883\u3001\u4f9d\u8d56\u5e93&#xff0c;\u5230\u5e94\u7528\u4ee3\u7801\u548c\u914d\u7f6e\u6587\u4ef6\u3002\u955c\u50cf\u5c31\u50cf\u4e00\u4e2a\u201c\u84dd\u56fe\u201d&#xff0c;\u53ef\u4ee5\u88ab\u591a\u6b21\u590d\u5236\u5e76\u8fd0\u884c&#xff0c;\u5f62\u6210\u591a\u4e2a\u76f8\u4e92\u9694\u79bb\u7684\u5bb9\u5668\u3002<\/p>\n<p>\u6838\u5fc3\u7279\u70b9&#xff1a;<\/p>\n<ul>\n<li>\u53ea\u8bfb\u4e0e\u5171\u4eab&#xff1a;\u955c\u50cf\u672c\u8eab\u662f\u53ea\u8bfb\u7684&#xff0c;\u591a\u4e2a\u5bb9\u5668\u53ef\u4ee5\u5171\u4eab\u540c\u4e00\u4e2a\u955c\u50cf&#xff0c;\u51cf\u5c11\u8d44\u6e90\u5360\u7528\u3002<\/li>\n<li>\u5206\u5c42\u7ed3\u6784&#xff1a;\u955c\u50cf\u7531\u591a\u4e2a\u201c\u5c42\u201d&#xff08;Layer&#xff09;\u7ec4\u6210&#xff0c;\u6bcf\u5c42\u4ee3\u8868\u4e00\u6b21\u6587\u4ef6\u7cfb\u7edf\u7684\u4fee\u6539&#xff0c;\u8fd9\u79cd\u8bbe\u8ba1\u8ba9\u955c\u50cf\u7684\u6784\u5efa\u548c\u4f20\u8f93\u66f4\u9ad8\u6548\u3002<\/li>\n<li>\u53ef\u590d\u7528\u4e0e\u53ef\u5b9a\u5236&#xff1a;\u53ef\u4ee5\u57fa\u4e8e\u5b98\u65b9\u955c\u50cf\u8fdb\u884c\u4e8c\u6b21\u5f00\u53d1&#xff0c;\u4e5f\u53ef\u4ee5\u5c06\u81ea\u5df1\u7684\u955c\u50cf\u5206\u4eab\u5230\u4ed3\u5e93\u3002<\/li>\n<\/ul>\n<p>\u955c\u50cf vs \u5bb9\u5668&#xff1a;<\/p>\n<ul>\n<li>\u955c\u50cf&#xff1a;\u9759\u6001\u7684\u201c\u6a21\u677f\u201d&#xff0c;\u7c7b\u4f3c\u7a0b\u5e8f\u7684\u5b89\u88c5\u5305\u3002<\/li>\n<li>\u5bb9\u5668&#xff1a;\u955c\u50cf\u7684\u8fd0\u884c\u5b9e\u4f8b&#xff0c;\u7c7b\u4f3c\u8fd0\u884c\u4e2d\u7684\u7a0b\u5e8f\u8fdb\u7a0b\u3002<\/li>\n<\/ul>\n<p>\u955c\u50cf\u7684\u8bbe\u8ba1\u8ba9\u5e94\u7528\u90e8\u7f72\u53d8\u5f97\u7b80\u5355&#xff1a;\u53ea\u9700\u62c9\u53d6\u955c\u50cf&#xff0c;\u5373\u53ef\u5728\u4efb\u4f55\u652f\u6301 Docker \u7684\u73af\u5883\u4e2d\u8fd0\u884c\u76f8\u540c\u7684\u5e94\u7528&#xff0c;\u5b9e\u73b0\u201c\u4e00\u6b21\u6784\u5efa&#xff0c;\u5230\u5904\u8fd0\u884c\u201d\u3002<\/p>\n<p>6. Docker \u4ed3\u5e93&#xff08;Docker Registries&#xff09; \u7c7b\u6bd4&#xff1a; Docker \u4ed3\u5e93\u5c31\u50cf\u4e00\u4e2a\u201c\u5e94\u7528\u5546\u5e97\u201d&#xff0c;\u53ea\u4e0d\u8fc7\u5b58\u50a8\u7684\u4e0d\u662f\u624b\u673a\u5e94\u7528&#xff0c;\u800c\u662f Docker \u955c\u50cf\u3002\u4f60\u53ef\u4ee5\u4ece\u8fd9\u91cc\u4e0b\u8f7d\u522b\u4eba\u505a\u597d\u7684\u955c\u50cf&#xff0c;\u4e5f\u53ef\u4ee5\u4e0a\u4f20\u81ea\u5df1\u7684\u955c\u50cf\u5206\u4eab\u7ed9\u4ed6\u4eba\u3002<\/p>\n<p>\u529f\u80fd&#xff1a;<\/p>\n<ul>\n<li>\u5b58\u50a8\u955c\u50cf&#xff1a;\u7c7b\u4f3c\u4e8e GitHub \u5b58\u50a8\u4ee3\u7801&#xff0c;Docker \u4ed3\u5e93\u5b58\u50a8\u955c\u50cf\u6587\u4ef6\u3002<\/li>\n<li>\u4e0a\u4f20\/\u4e0b\u8f7d&#xff1a;\u652f\u6301\u7528\u6237\u4e0a\u4f20\u81ea\u5b9a\u4e49\u955c\u50cf\u6216\u4e0b\u8f7d\u516c\u5171\u955c\u50cf\u3002<\/li>\n<li>\u5b98\u65b9\u4e0e\u793e\u533a\u8d44\u6e90&#xff1a;Docker Hub&#xff08;\u9ed8\u8ba4\u516c\u5171\u4ed3\u5e93&#xff09;\u63d0\u4f9b\u5927\u91cf\u5b98\u65b9\u955c\u50cf&#xff08;\u5982 Ubuntu\u3001MySQL&#xff09;\u548c\u793e\u533a\u8d21\u732e\u7684\u955c\u50cf\u3002<\/li>\n<\/ul>\n<p>7. Docker Compose \u7c7b\u6bd4&#xff1a; \u5982\u679c\u4f60\u9700\u8981\u540c\u65f6\u8fd0\u884c\u591a\u4e2a\u5bb9\u5668&#xff08;\u6bd4\u5982\u4e00\u4e2a\u7f51\u7ad9\u548c\u6570\u636e\u5e93&#xff09;&#xff0c;Docker Compose \u5c31\u50cf\u4e00\u4e2a\u201c\u6279\u91cf\u542f\u52a8\u5668\u201d&#xff0c;\u7528\u4e00\u4e2a\u914d\u7f6e\u6587\u4ef6\u5c31\u80fd\u4e00\u952e\u542f\u52a8\u6240\u6709\u670d\u52a1\u3002<\/p>\n<p>\u529f\u80fd&#xff1a;<\/p>\n<ul>\n<li>\u591a\u5bb9\u5668\u7ba1\u7406&#xff1a;\u901a\u8fc7\u4e00\u4e2a docker-compose.yml \u6587\u4ef6\u5b9a\u4e49\u591a\u4e2a\u5bb9\u5668\u53ca\u5176\u5173\u7cfb\u3002<\/li>\n<li>\u7b80\u5316\u90e8\u7f72&#xff1a;\u53ea\u9700\u4e00\u6761\u547d\u4ee4\u5373\u53ef\u542f\u52a8\/\u505c\u6b62\u6574\u4e2a\u5e94\u7528\u3002<\/li>\n<\/ul>\n<p>8. Docker Swarm \u7c7b\u6bd4&#xff1a; \u5982\u679c\u4f60\u6709\u591a\u53f0\u670d\u52a1\u5668&#xff08;\u4e3b\u673a&#xff09;&#xff0c;Docker Swarm \u5c31\u50cf\u4e00\u4e2a\u201c\u6307\u6325\u5b98\u201d&#xff0c;\u80fd\u628a\u5b83\u4eec\u7ec4\u5efa\u6210\u4e00\u4e2a\u201c\u96c6\u7fa4\u201d&#xff0c;\u7edf\u4e00\u7ba1\u7406\u548c\u5206\u914d\u4efb\u52a1\u3002<\/p>\n<p>\u529f\u80fd&#xff1a;<\/p>\n<ul>\n<li>\u96c6\u7fa4\u7ba1\u7406&#xff1a;\u5c06\u591a\u53f0 Docker \u4e3b\u673a\u7ec4\u6210\u4e00\u4e2a\u903b\u8f91\u96c6\u7fa4\u3002<\/li>\n<li>\u81ea\u52a8\u6269\u5c55&#xff1a;\u6839\u636e\u8d1f\u8f7d\u81ea\u52a8\u589e\u52a0\u6216\u51cf\u5c11\u5bb9\u5668\u6570\u91cf\u3002<\/li>\n<li>\u9ad8\u53ef\u7528\u6027&#xff1a;\u5f53\u67d0\u4e2a\u5bb9\u5668\u6545\u969c\u65f6&#xff0c;\u81ea\u52a8\u91cd\u65b0\u90e8\u7f72\u3002<\/li>\n<\/ul>\n<p>9. Docker \u7f51\u7edc&#xff08;Docker Networks&#xff09; \u7c7b\u6bd4&#xff1a; Docker \u7f51\u7edc\u5c31\u50cf\u7ed9\u5bb9\u5668\u642d\u5efa\u7684\u201c\u865a\u62df\u5c40\u57df\u7f51\u201d&#xff0c;\u8ba9\u5bb9\u5668\u4e4b\u95f4\u53ef\u4ee5\u4e92\u76f8\u901a\u4fe1&#xff0c;\u4e5f\u80fd\u4e0e\u5916\u90e8\u7f51\u7edc\u8fde\u63a5\u3002<\/p>\n<p>\u529f\u80fd&#xff1a;<\/p>\n<ul>\n<li>\u5bb9\u5668\u901a\u4fe1&#xff1a;\u4e0d\u540c\u5bb9\u5668\u53ef\u901a\u8fc7\u7f51\u7edc\u4e92\u76f8\u8bbf\u95ee\u3002<\/li>\n<li>\u9694\u79bb\u4e0e\u5b89\u5168&#xff1a;\u901a\u8fc7\u81ea\u5b9a\u4e49\u7f51\u7edc\u9694\u79bb\u4e0d\u540c\u5e94\u7528\u3002<\/li>\n<\/ul>\n<p>\u5e38\u89c1\u7f51\u7edc\u6a21\u5f0f&#xff1a;<\/p>\n<ul>\n<li>bridge&#xff08;\u9ed8\u8ba4&#xff09;&#xff1a;\u5bb9\u5668\u901a\u8fc7\u5bbf\u4e3b\u673a\u7684\u865a\u62df\u7f51\u6865\u901a\u4fe1\u3002<\/li>\n<li>host&#xff1a;\u5bb9\u5668\u76f4\u63a5\u4f7f\u7528\u5bbf\u4e3b\u673a\u7f51\u7edc&#xff08;\u65e0\u9694\u79bb&#xff09;\u3002<\/li>\n<li>overlay&#xff1a;\u8de8\u4e3b\u673a\u96c6\u7fa4\u7f51\u7edc&#xff08;\u7528\u4e8e Swarm&#xff09;\u3002<\/li>\n<\/ul>\n<p>10. Docker \u5377&#xff08;Docker Volumes&#xff09; \u7c7b\u6bd4&#xff1a; \u5bb9\u5668\u7684\u6587\u4ef6\u7cfb\u7edf\u5c31\u50cf\u201c\u4e34\u65f6\u5b58\u50a8\u201d&#xff0c;\u5bb9\u5668\u5220\u9664\u540e\u6570\u636e\u4f1a\u4e22\u5931\u3002\u800c Docker \u5377\u5c31\u50cf\u4e00\u4e2a\u201c\u5916\u6302\u786c\u76d8\u201d&#xff0c;\u6570\u636e\u72ec\u7acb\u4e8e\u5bb9\u5668&#xff0c;\u4e0d\u4f1a\u4e22\u5931\u3002<\/p>\n<p>\u529f\u80fd&#xff1a;<\/p>\n<ul>\n<li>\u6570\u636e\u6301\u4e45\u5316&#xff1a;\u5bb9\u5668\u5220\u9664\u540e&#xff0c;\u5377\u4e2d\u7684\u6570\u636e\u4f9d\u7136\u4fdd\u7559\u3002<\/li>\n<li>\u6570\u636e\u5171\u4eab&#xff1a;\u591a\u4e2a\u5bb9\u5668\u53ef\u6302\u8f7d\u540c\u4e00\u4e2a\u5377\u5171\u4eab\u6570\u636e\u3002<\/li>\n<\/ul>\n<p>\u603b\u7ed3\u5bf9\u6bd4\u8868<\/p>\n<table>\n<tr>\u6982\u5ff5\u4f5c\u7528\u9002\u5408\u573a\u666f<\/tr>\n<tbody>\n<tr>\n<td>\u955c\u50cf<\/td>\n<td>\u4f5c\u4e3a\u5bb9\u5668\u7684\u53ea\u8bfb\u6a21\u677f&#xff0c;\u5c01\u88c5\u5e94\u7528\u7a0b\u5e8f\u53ca\u5176\u4f9d\u8d56\u73af\u5883&#xff08;\u5982\u64cd\u4f5c\u7cfb\u7edf\u3001\u8fd0\u884c\u65f6\u3001\u5e93\u548c\u4ee3\u7801\u7b49&#xff09;&#xff0c;\u662f\u5bb9\u5668\u521b\u5efa\u7684\u57fa\u7840&#xff1b;\u901a\u8fc7\u5206\u5c42\u5b58\u50a8\u5b9e\u73b0\u590d\u7528\u4e0e\u9ad8\u6548\u4f20\u8f93<\/td>\n<td>\u5f00\u53d1\u9636\u6bb5\u6784\u5efa\u5e94\u7528\u8fd0\u884c\u73af\u5883&#xff1b;\u6253\u5305\u5e94\u7528\u4ea4\u4ed8\u6d4b\u8bd5\u4e0e\u751f\u4ea7\u73af\u5883&#xff1b;\u4f5c\u4e3a\u516c\u5171\u57fa\u7840\u955c\u50cf\u4f9b\u56e2\u961f\u4f7f\u7528<\/td>\n<\/tr>\n<tr>\n<td>\u5bb9\u5668<\/td>\n<td>\u955c\u50cf\u7684\u8fd0\u884c\u5b9e\u4f8b&#xff0c;\u63d0\u4f9b\u8f7b\u91cf\u7ea7\u3001\u9694\u79bb\u7684\u8fd0\u884c\u73af\u5883&#xff0c;\u5305\u542b\u53ef\u8bfb\u5199\u5c42&#xff0c;\u5b9e\u73b0\u5e94\u7528\u7684\u5feb\u901f\u90e8\u7f72\u4e0e\u8fd0\u884c&#xff1b;\u652f\u6301\u52a8\u6001\u542f\u505c\u3001\u6269\u5c55\u548c\u8fc1\u79fb<\/td>\n<td>\u5fae\u670d\u52a1\u67b6\u6784\u4e2d\u72ec\u7acb\u90e8\u7f72\u670d\u52a1&#xff1b;CI\/CD\u6d41\u6c34\u7ebf\u5feb\u901f\u4ea4\u4ed8\u5e94\u7528&#xff1b;\u9694\u79bb\u4e0d\u540c\u7248\u672c\u6216\u529f\u80fd\u7684\u5e94\u7528<\/td>\n<\/tr>\n<tr>\n<td>\u4ed3\u5e93<\/td>\n<td>\u5b58\u50a8\u548c\u5206\u4eab\u955c\u50cf&#xff0c;\u5206\u4e3a\u516c\u5171\u4ed3\u5e93&#xff08;\u5982Docker Hub&#xff09;\u548c\u79c1\u6709\u4ed3\u5e93&#xff1b;\u652f\u6301\u955c\u50cf\u7684\u4e0a\u4f20\u3001\u4e0b\u8f7d\u4e0e\u7248\u672c\u7ba1\u7406<\/td>\n<td>\u56e2\u961f\u534f\u4f5c\u5171\u4eab\u81ea\u5b9a\u4e49\u955c\u50cf&#xff1b;\u83b7\u53d6\u516c\u5171\u5f00\u6e90\u955c\u50cf\u52a0\u901f\u5f00\u53d1&#xff1b;\u4f01\u4e1a\u5185\u90e8\u5b89\u5168\u5b58\u50a8\u654f\u611f\u955c\u50cf<\/td>\n<\/tr>\n<tr>\n<td>Compose<\/td>\n<td>\u901a\u8fc7YAML\u6587\u4ef6\u5b9a\u4e49\u591a\u5bb9\u5668\u5e94\u7528\u7684\u914d\u7f6e&#xff08;\u670d\u52a1\u3001\u7f51\u7edc\u3001\u5377\u7b49&#xff09;&#xff0c;\u5b9e\u73b0\u4e00\u952e\u7f16\u6392\u548c\u7ba1\u7406\u591a\u4e2a\u5173\u8054\u5bb9\u5668<\/td>\n<td>\u672c\u5730\u5f00\u53d1\u540c\u65f6\u542f\u52a8\u524d\u540e\u7aef\u670d\u52a1\u4e0e\u6570\u636e\u5e93&#xff1b;\u642d\u5efa\u590d\u6742\u6d4b\u8bd5\u73af\u5883&#xff1b;\u5feb\u901f\u90e8\u7f72\u5c0f\u578b\u591a\u670d\u52a1\u5e94\u7528<\/td>\n<\/tr>\n<tr>\n<td>Swarm<\/td>\n<td>\u5c06\u591a\u53f0Docker\u4e3b\u673a\u7ec4\u6210\u96c6\u7fa4&#xff0c;\u5b9e\u73b0\u5bb9\u5668\u7684\u96c6\u7fa4\u5316\u7ba1\u7406&#xff0c;\u652f\u6301\u8d1f\u8f7d\u5747\u8861\u3001\u9ad8\u53ef\u7528\u548c\u81ea\u52a8\u6269\u5c55<\/td>\n<td>\u5927\u578b\u751f\u4ea7\u73af\u5883\u7684\u5206\u5e03\u5f0f\u90e8\u7f72&#xff1b;\u5e94\u5bf9\u9ad8\u5e76\u53d1\u6d41\u91cf\u7684\u5f39\u6027\u4f38\u7f29&#xff1b;\u8de8\u4e3b\u673a\u8d44\u6e90\u8c03\u5ea6<\/td>\n<\/tr>\n<tr>\n<td>\u7f51\u7edc<\/td>\n<td>\u7ba1\u7406\u5bb9\u5668\u95f4\u7684\u901a\u4fe1\u4e0e\u9694\u79bb&#xff0c;\u63d0\u4f9b\u591a\u79cd\u7f51\u7edc\u6a21\u5f0f&#xff08;\u5982bridge\u3001host\u3001overlay&#xff09;&#xff0c;\u652f\u6301\u5bb9\u5668\u670d\u52a1\u53d1\u73b0\u4e0e\u8bbf\u95ee<\/td>\n<td>\u591a\u5bb9\u5668\u670d\u52a1\u95f4\u6570\u636e\u4ea4\u4e92&#xff1b;\u9694\u79bb\u4e0d\u540c\u5b89\u5168\u7ea7\u522b\u7684\u5e94\u7528&#xff1b;\u8de8\u4e3b\u673a\u96c6\u7fa4\u5185\u5bb9\u5668\u901a\u4fe1<\/td>\n<\/tr>\n<tr>\n<td>\u5377<\/td>\n<td>\u5b9e\u73b0\u6570\u636e\u6301\u4e45\u5316&#xff0c;\u72ec\u7acb\u4e8e\u5bb9\u5668\u751f\u547d\u5468\u671f&#xff0c;\u652f\u6301\u5bb9\u5668\u95f4\u6570\u636e\u5171\u4eab&#xff1b;\u907f\u514d\u5bb9\u5668\u5220\u9664\u5bfc\u81f4\u6570\u636e\u4e22\u5931<\/td>\n<td>\u6570\u636e\u5e93\u5b58\u50a8\u6570\u636e&#xff1b;\u5e94\u7528\u65e5\u5fd7\u6301\u4e45\u5316&#xff1b;\u5171\u4eab\u914d\u7f6e\u6587\u4ef6\u6216\u4e0a\u4f20\u6587\u4ef6<\/td>\n<\/tr>\n<tr>\n<td>\u5ba2\u6237\u7aef<\/td>\n<td>\u4f5c\u4e3a\u7528\u6237\u4e0eDocker\u4ea4\u4e92\u7684\u547d\u4ee4\u884c\u63a5\u53e3&#xff08;CLI&#xff09;&#xff0c;\u53d1\u9001\u6307\u4ee4&#xff08;\u5982\u521b\u5efa\u5bb9\u5668\u3001\u6784\u5efa\u955c\u50cf&#xff09;\u5230\u5b88\u62a4\u8fdb\u7a0b<\/td>\n<td>\u65e5\u5e38\u5f00\u53d1\u8fd0\u7ef4\u64cd\u4f5c&#xff1b;\u81ea\u52a8\u5316\u811a\u672c\u6267\u884cDocker\u547d\u4ee4&#xff1b;\u4e0e\u5b88\u62a4\u8fdb\u7a0b\u4ea4\u4e92\u7ba1\u7406\u5bb9\u5668<\/td>\n<\/tr>\n<tr>\n<td>\u5b88\u62a4\u8fdb\u7a0b<\/td>\n<td>\u4f5c\u4e3aDocker\u67b6\u6784\u6838\u5fc3&#xff0c;\u8d1f\u8d23\u5904\u7406\u5ba2\u6237\u7aef\u8bf7\u6c42&#xff0c;\u7ba1\u7406\u5bb9\u5668\u751f\u547d\u5468\u671f\u3001\u955c\u50cf\u6784\u5efa\u4e0e\u5206\u53d1\u7b49\u540e\u53f0\u4efb\u52a1<\/td>\n<td>\u6301\u7eed\u76d1\u63a7\u4e0e\u7ef4\u62a4Docker\u73af\u5883&#xff1b;\u6267\u884c\u5bb9\u5668\u521b\u5efa\u3001\u542f\u52a8\u3001\u505c\u6b62\u7b49\u64cd\u4f5c&#xff1b;\u7ba1\u7406\u8d44\u6e90\u5206\u914d<\/td>\n<\/tr>\n<tr>\n<td>\u5f15\u64ce<\/td>\n<td>\u63d0\u4f9bRESTful API\u63a5\u53e3&#xff0c;\u5141\u8bb8\u5916\u90e8\u5ba2\u6237\u7aef&#xff08;\u5982\u7f16\u7a0b\u8bed\u8a00\u3001\u5de5\u5177&#xff09;\u901a\u8fc7HTTP\u8bf7\u6c42\u4e0e\u5b88\u62a4\u8fdb\u7a0b\u901a\u4fe1<\/td>\n<td>\u5f00\u53d1\u81ea\u5b9a\u4e49\u7ba1\u7406\u5de5\u5177&#xff1b;\u96c6\u6210Docker\u529f\u80fd\u5230\u81ea\u52a8\u5316\u5e73\u53f0&#xff1b;\u901a\u8fc7\u7f16\u7a0b\u65b9\u5f0f\u63a7\u5236\u5bb9\u5668<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>1.3 docker\u7684\u9694\u79bb\u673a\u5236<\/h3>\n<p>Docker \u7684\u9694\u79bb\u673a\u5236\u662f\u5176\u6838\u5fc3\u4f18\u52bf\u4e4b\u4e00&#xff0c;\u4e3b\u8981\u57fa\u4e8e Linux \u5185\u6838\u7684 Namespaces \u548c Cgroups \u6280\u672f\u5b9e\u73b0&#xff0c;\u540c\u65f6\u7ed3\u5408\u6587\u4ef6\u7cfb\u7edf\u548c\u7f51\u7edc\u9694\u79bb&#xff0c;\u786e\u4fdd\u5bb9\u5668\u95f4\u76f8\u4e92\u72ec\u7acb\u4e14\u8d44\u6e90\u53ef\u63a7\u3002<\/p>\n<p>1. Namespaces&#xff08;\u547d\u540d\u7a7a\u95f4&#xff09; Namespaces \u662f Linux \u5185\u6838\u63d0\u4f9b\u7684\u4e00\u79cd\u9694\u79bb\u673a\u5236&#xff0c;Docker \u901a\u8fc7\u5b83\u5c06\u5bb9\u5668\u7684\u4e0d\u540c\u8d44\u6e90&#xff08;\u5982\u8fdb\u7a0b\u3001\u7f51\u7edc\u3001\u6587\u4ef6\u7cfb\u7edf\u7b49&#xff09;\u9694\u79bb\u5230\u72ec\u7acb\u7684\u547d\u540d\u7a7a\u95f4\u4e2d&#xff0c;\u4f7f\u5bb9\u5668\u5185\u7684\u8fdb\u7a0b\u770b\u8d77\u6765\u50cf\u662f\u5728\u72ec\u7acb\u7684\u73af\u5883\u4e2d\u8fd0\u884c\u3002<\/p>\n<p>\u4e3b\u8981 Namespaces \u7c7b\u578b&#xff1a;<\/p>\n<ul>\n<li>PID Namespace&#xff1a;\u9694\u79bb\u8fdb\u7a0b ID&#xff0c;\u6bcf\u4e2a\u5bb9\u5668\u6709\u72ec\u7acb\u7684\u8fdb\u7a0b\u6811&#xff08;\u5bb9\u5668\u5185\u7684 PID 1 \u4e0e\u5bbf\u4e3b\u673a\u65e0\u5173&#xff09;\u3002<\/li>\n<li>NET Namespace&#xff1a;\u9694\u79bb\u7f51\u7edc\u6808&#xff0c;\u6bcf\u4e2a\u5bb9\u5668\u6709\u72ec\u7acb\u7684\u7f51\u7edc\u63a5\u53e3\u3001IP \u5730\u5740\u548c\u7aef\u53e3\u7a7a\u95f4\u3002<\/li>\n<li>MNT Namespace&#xff1a;\u9694\u79bb\u6587\u4ef6\u7cfb\u7edf\u6302\u8f7d\u70b9&#xff0c;\u5bb9\u5668\u6709\u72ec\u7acb\u7684\u6839\u6587\u4ef6\u7cfb\u7edf\u3002<\/li>\n<li>UTS Namespace&#xff1a;\u9694\u79bb\u4e3b\u673a\u540d\u548c\u57df\u540d&#xff0c;\u5bb9\u5668\u53ef\u81ea\u5b9a\u4e49\u4e3b\u673a\u540d\u3002<\/li>\n<li>IPC Namespace&#xff1a;\u9694\u79bb\u8fdb\u7a0b\u95f4\u901a\u4fe1&#xff08;\u5982\u6d88\u606f\u961f\u5217\u3001\u5171\u4eab\u5185\u5b58&#xff09;\u3002<\/li>\n<li>USER Namespace&#xff1a;\u9694\u79bb\u7528\u6237\u548c\u7528\u6237\u7ec4&#xff0c;\u5bb9\u5668\u5185\u7684\u7528\u6237\u53ef\u6620\u5c04\u5230\u5bbf\u4e3b\u673a\u7684\u4e0d\u540c UID\u3002<\/li>\n<\/ul>\n<p>\u4f5c\u7528&#xff1a;<\/p>\n<ul>\n<li>\u5bb9\u5668\u5185\u7684\u8fdb\u7a0b\u65e0\u6cd5\u770b\u5230\u6216\u5f71\u54cd\u5176\u4ed6\u5bb9\u5668\u7684\u8fdb\u7a0b\u3002<\/li>\n<li>\u5bb9\u5668\u53ef\u4f7f\u7528\u76f8\u540c\u7684\u7aef\u53e3&#xff08;\u5982 80&#xff09;&#xff0c;\u4f46\u5728\u4e0d\u540c\u7684\u7f51\u7edc\u547d\u540d\u7a7a\u95f4\u4e2d\u4e92\u4e0d\u51b2\u7a81\u3002<\/li>\n<\/ul>\n<p>\u4e00\u4e2a\u5bb9\u5668\u5305\u542b\u591a\u4e2a\u8fdb\u7a0b<\/p>\n<p>2. Cgroups&#xff08;\u63a7\u5236\u7ec4&#xff09; Cgroups&#xff08;Control Groups&#xff09;\u662f Linux \u5185\u6838\u7684\u53e6\u4e00\u9879\u6280\u672f&#xff0c;\u7528\u4e8e\u9650\u5236\u548c\u76d1\u63a7\u5bb9\u5668\u7684\u8d44\u6e90\u4f7f\u7528&#xff08;\u5982 CPU\u3001\u5185\u5b58\u3001\u78c1\u76d8 I\/O\u3001\u7f51\u7edc\u5e26\u5bbd\u7b49&#xff09;&#xff0c;\u9632\u6b62\u5355\u4e2a\u5bb9\u5668\u8017\u5c3d\u7cfb\u7edf\u8d44\u6e90\u3002<\/p>\n<p>\u4e3b\u8981\u529f\u80fd&#xff1a;<\/p>\n<ul>\n<li>\u8d44\u6e90\u9650\u5236&#xff1a;\u8bbe\u7f6e\u5bb9\u5668\u7684 CPU \u4f7f\u7528\u7387\u4e0a\u9650\u3001\u5185\u5b58\u914d\u989d\u7b49\u3002<\/li>\n<li>\u4f18\u5148\u7ea7\u63a7\u5236&#xff1a;\u8c03\u6574\u5bb9\u5668\u7684\u8d44\u6e90\u4f7f\u7528\u4f18\u5148\u7ea7\u3002<\/li>\n<li>\u8d44\u6e90\u7edf\u8ba1&#xff1a;\u76d1\u63a7\u5bb9\u5668\u7684\u8d44\u6e90\u4f7f\u7528\u60c5\u51b5&#xff08;\u5982 CPU\u3001\u5185\u5b58\u7528\u91cf&#xff09;\u3002<\/li>\n<li>\u8fdb\u7a0b\u7ec8\u6b62&#xff1a;\u5f53\u5bb9\u5668\u8d85\u51fa\u8d44\u6e90\u9650\u5236\u65f6&#xff0c;\u53ef\u81ea\u52a8\u7ec8\u6b62\u8fdb\u7a0b<\/li>\n<\/ul>\n<p>3. \u8054\u5408\u6587\u4ef6\u7cfb\u7edf&#xff08;UnionFS&#xff09; Docker \u4f7f\u7528\u8054\u5408\u6587\u4ef6\u7cfb\u7edf&#xff08;\u5982 Overlay2\u3001AUFS \u7b49&#xff09;\u5b9e\u73b0\u955c\u50cf\u7684\u5206\u5c42\u5b58\u50a8\u548c\u5bb9\u5668\u7684\u53ef\u5199\u5c42\u3002\u6bcf\u4e2a\u5bb9\u5668\u5728\u53ea\u8bfb\u7684\u955c\u50cf\u5c42\u4e4b\u4e0a\u6dfb\u52a0\u4e00\u4e2a\u53ef\u5199\u5c42&#xff0c;\u4fee\u6539\u53ea\u53d1\u751f\u5728\u5bb9\u5668\u7684\u53ef\u5199\u5c42&#xff0c;\u4e0d\u4f1a\u5f71\u54cd\u5e95\u5c42\u955c\u50cf\u3002<\/p>\n<p>\u7279\u6027&#xff1a;<\/p>\n<ul>\n<li>\u5199\u65f6\u590d\u5236&#xff08;Copy-on-Write&#xff09;&#xff1a;\u53ea\u6709\u5f53\u5bb9\u5668\u4fee\u6539\u6587\u4ef6\u65f6&#xff0c;\u624d\u4f1a\u4ece\u955c\u50cf\u5c42\u590d\u5236\u6587\u4ef6\u5230\u53ef\u5199\u5c42\u3002<\/li>\n<li>\u9ad8\u6548\u590d\u7528&#xff1a;\u591a\u4e2a\u5bb9\u5668\u53ef\u5171\u4eab\u540c\u4e00\u4e2a\u955c\u50cf\u5c42&#xff0c;\u8282\u7701\u5b58\u50a8\u7a7a\u95f4\u3002<\/li>\n<\/ul>\n<p>4. \u7f51\u7edc\u9694\u79bb Docker \u63d0\u4f9b\u591a\u79cd\u7f51\u7edc\u6a21\u5f0f&#xff08;\u5982 bridge\u3001host\u3001overlay \u7b49&#xff09;&#xff0c;\u9ed8\u8ba4\u4f7f\u7528 bridge \u6a21\u5f0f\u521b\u5efa\u865a\u62df\u7f51\u7edc&#xff0c;\u5b9e\u73b0\u5bb9\u5668\u95f4\u7684\u9694\u79bb\u4e0e\u901a\u4fe1\u3002<\/p>\n<p>\u5e38\u89c1\u7f51\u7edc\u6a21\u5f0f&#xff1a;<\/p>\n<ul>\n<li>bridge&#xff1a;\u5bb9\u5668\u901a\u8fc7\u865a\u62df\u7f51\u6865&#xff08;docker0&#xff09;\u8fde\u63a5\u5230\u5bbf\u4e3b\u673a\u7f51\u7edc&#xff0c;\u5bb9\u5668\u95f4\u901a\u8fc7 IP \u6216\u5bb9\u5668\u540d\u901a\u4fe1\u3002<\/li>\n<li>host&#xff1a;\u5bb9\u5668\u76f4\u63a5\u4f7f\u7528\u5bbf\u4e3b\u673a\u7684\u7f51\u7edc\u6808&#xff0c;\u65e0\u7f51\u7edc\u9694\u79bb&#xff08;\u6027\u80fd\u9ad8&#xff0c;\u4f46\u7aef\u53e3\u51b2\u7a81\u98ce\u9669&#xff09;\u3002<\/li>\n<li>overlay&#xff1a;\u8de8\u4e3b\u673a\u96c6\u7fa4\u7f51\u7edc&#xff0c;\u7528\u4e8e Swarm \u6216 Kubernetes \u73af\u5883\u3002<\/li>\n<li>none&#xff1a;\u7981\u7528\u7f51\u7edc&#xff0c;\u5bb9\u5668\u65e0\u6cd5\u8054\u7f51\u3002<\/li>\n<\/ul>\n<p>5. \u5b89\u5168\u589e\u5f3a Docker \u8fd8\u901a\u8fc7\u4ee5\u4e0b\u6280\u672f\u8fdb\u4e00\u6b65\u5f3a\u5316\u9694\u79bb&#xff1a;<\/p>\n<ul>\n<li>Seccomp&#xff08;Secure Computing Mode&#xff09;&#xff1a;\u9650\u5236\u5bb9\u5668\u5185\u8fdb\u7a0b\u7684\u7cfb\u7edf\u8c03\u7528\u6743\u9650\u3002<\/li>\n<li>AppArmor\/SELinux&#xff1a;\u4e3a\u5bb9\u5668\u5e94\u7528\u5f3a\u5236\u8bbf\u95ee\u63a7\u5236&#xff08;MAC&#xff09;\u7b56\u7565\u3002<\/li>\n<li>Capabilities&#xff1a;\u7ec6\u7c92\u5ea6\u63a7\u5236\u5bb9\u5668\u7684\u7279\u6743&#xff08;\u5982\u7981\u7528\u4e0d\u5fc5\u8981\u7684\u7cfb\u7edf\u6743\u9650&#xff09;\u3002<\/li>\n<\/ul>\n<p>\u9694\u79bb\u673a\u5236 vs \u865a\u62df\u673a<\/p>\n<table>\n<tr>\u7279\u6027\u5bb9\u5668&#xff08;Docker&#xff09;\u865a\u62df\u673a&#xff08;VM&#xff09;<\/tr>\n<tbody>\n<tr>\n<td>\u9694\u79bb\u7ea7\u522b<\/td>\n<td>\u8fdb\u7a0b\u7ea7&#xff08;\u5171\u4eab\u5185\u6838&#xff09;<\/td>\n<td>\u786c\u4ef6\u7ea7&#xff08;\u72ec\u7acb\u5185\u6838&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u542f\u52a8\u901f\u5ea6<\/td>\n<td>\u79d2\u7ea7<\/td>\n<td>\u5206\u949f\u7ea7<\/td>\n<\/tr>\n<tr>\n<td>\u8d44\u6e90\u5360\u7528<\/td>\n<td>\u4f4e&#xff08;\u4ec5\u9700\u5fc5\u8981\u4f9d\u8d56&#xff09;<\/td>\n<td>\u9ad8&#xff08;\u5b8c\u6574\u64cd\u4f5c\u7cfb\u7edf&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u6027\u80fd<\/td>\n<td>\u63a5\u8fd1\u539f\u751f<\/td>\n<td>\u6709 Hypervisor \u5f00\u9500<\/td>\n<\/tr>\n<tr>\n<td>\u9694\u79bb\u5b89\u5168\u6027<\/td>\n<td>\u4e2d\u7b49&#xff08;\u9700\u914d\u7f6e\u5b89\u5168\u7b56\u7565&#xff09;<\/td>\n<td>\u9ad8&#xff08;\u5b8c\u5168\u9694\u79bb&#xff09;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u603b\u7ed3 Docker \u7684\u9694\u79bb\u673a\u5236\u901a\u8fc7 Namespaces \u5b9e\u73b0\u8d44\u6e90\u7684\u903b\u8f91\u9694\u79bb&#xff0c;Cgroups \u63a7\u5236\u8d44\u6e90\u4f7f\u7528&#xff0c;\u8054\u5408\u6587\u4ef6\u7cfb\u7edf \u7ba1\u7406\u5b58\u50a8&#xff0c;\u7f51\u7edc\u6a21\u5f0f \u9694\u79bb\u901a\u4fe1&#xff0c;\u6700\u7ec8\u8fbe\u5230\u8f7b\u91cf\u7ea7\u3001\u9ad8\u6027\u80fd\u7684\u5e94\u7528\u9694\u79bb\u6548\u679c\u3002\u8fd9\u79cd\u8bbe\u8ba1\u4f7f\u5f97\u5bb9\u5668\u80fd\u5728\u5171\u4eab\u5185\u6838\u7684\u524d\u63d0\u4e0b&#xff0c;\u5b89\u5168\u3001\u9ad8\u6548\u5730\u8fd0\u884c\u591a\u4e2a\u72ec\u7acb\u5e94\u7528&#xff0c;\u6210\u4e3a\u5fae\u670d\u52a1\u548c DevOps \u7684\u7406\u60f3\u9009\u62e9\u3002<\/p>\n<h2>2 \u5b89\u88c5docker<\/h2>\n<h3>2.1 \u524d\u671f\u5de5\u4f5c<\/h3>\n<p><span class=\"token comment\"># \u66f4\u65b0 \u7d22\u5f15<\/span><br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">apt-get<\/span> update<br \/>\n<span class=\"token comment\"># \u5b89\u88c5 \u4f9d\u8d56<\/span><br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">apt-get<\/span> <span class=\"token function\">install<\/span> <span class=\"token punctuation\">\\\\<\/span><br \/>\n    apt-transport-https <span class=\"token punctuation\">\\\\<\/span><br \/>\n    ca-certificates <span class=\"token punctuation\">\\\\<\/span><br \/>\n    <span class=\"token function\">curl<\/span> <span class=\"token punctuation\">\\\\<\/span><br \/>\n    gnupg-agent <span class=\"token punctuation\">\\\\<\/span><br \/>\n    software-properties-common<br \/>\n <span class=\"token comment\"># \u5b89\u88c5 \u6dfb\u52a0 Docker \u7684\u5b98\u65b9 GPG \u5bc6\u94a5<\/span><br \/>\n <span class=\"token function\">sudo<\/span> <span class=\"token function\">curl<\/span> -fsSL https:\/\/mirrors.ustc.edu.cn\/docker-ce\/linux\/ubuntu\/gpg -o \/etc\/apt\/keyrings\/docker.asc<br \/>\n<span class=\"token comment\"># \u4f7f\u7528\u4ee5\u4e0b\u6307\u4ee4\u8bbe\u7f6e\u7a33\u5b9a\u7248\u4ed3\u5e93<\/span><br \/>\n<span class=\"token builtin class-name\">echo<\/span> <span class=\"token punctuation\">\\\\<\/span><br \/>\n  <span class=\"token string\">&#034;deb [arch&#061;<span class=\"token variable\"><span class=\"token variable\">$(<\/span>dpkg &#8211;print-architecture<span class=\"token variable\">)<\/span><\/span> signed-by&#061;\/etc\/apt\/keyrings\/docker.asc] https:\/\/mirrors.ustc.edu.cn\/docker-ce\/linux\/ubuntu\/ \\\\<br \/>\n  <span class=\"token variable\"><span class=\"token variable\">$(<\/span><span class=\"token builtin class-name\">.<\/span> \/etc\/os-release <span class=\"token operator\">&amp;&amp;<\/span> <span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;<span class=\"token variable\">$VERSION_CODENAME<\/span>&#034;<\/span><span class=\"token variable\">)<\/span><\/span> stable&#034;<\/span> <span class=\"token operator\">|<\/span> <span class=\"token punctuation\">\\\\<\/span><br \/>\n  <span class=\"token function\">sudo<\/span> <span class=\"token function\">tee<\/span> \/etc\/apt\/sources.list.d\/docker.list <span class=\"token operator\">&gt;<\/span> \/dev\/null<br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">apt-get<\/span> update<\/p>\n<h3>2.2 \u5b89\u88c5\u5f15\u64ce<\/h3>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">apt-get<\/span> update<br \/>\n<span class=\"token comment\"># \u5b89\u88c5\u6700\u65b0\u7248<\/span><br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">apt-get<\/span> <span class=\"token function\">install<\/span> docker-ce docker-ce-cli containerd.io<\/p>\n<p>\u6216\u8005\u5b89\u88c5\u7279\u5b9a\u7248\u672c<\/p>\n<p><span class=\"token comment\">#\u8981\u5b89\u88c5\u7279\u5b9a\u7248\u672c\u7684 Docker Engine-Community&#xff0c; <\/span><br \/>\n<span class=\"token function\">apt-cache<\/span> madison docker-ce<\/p>\n<p>  docker-ce <span class=\"token operator\">|<\/span> <span class=\"token number\">5<\/span>:18.09.1~3-0~ubuntu-xenial <span class=\"token operator\">|<\/span> https:\/\/mirrors.ustc.edu.cn\/docker-ce\/linux\/ubuntu  xenial\/stable amd64 Packages<br \/>\n  docker-ce <span class=\"token operator\">|<\/span> <span class=\"token number\">5<\/span>:18.09.0~3-0~ubuntu-xenial <span class=\"token operator\">|<\/span> https:\/\/mirrors.ustc.edu.cn\/docker-ce\/linux\/ubuntu  xenial\/stable amd64 Packages<br \/>\n  docker-ce <span class=\"token operator\">|<\/span> <span class=\"token number\">18.06<\/span>.1~ce~3-0~ubuntu       <span class=\"token operator\">|<\/span> https:\/\/mirrors.ustc.edu.cn\/docker-ce\/linux\/ubuntu  xenial\/stable amd64 Packages<br \/>\n  docker-ce <span class=\"token operator\">|<\/span> <span class=\"token number\">18.06<\/span>.0~ce~3-0~ubuntu       <span class=\"token operator\">|<\/span> https:\/\/mirrors.ustc.edu.cn\/docker-ce\/linux\/ubuntu  xenial\/stable amd64 Packages<br \/>\n<span class=\"token comment\"># \u547d\u4ee4<\/span><br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">apt-get<\/span> <span class=\"token function\">install<\/span> docker-ce<span class=\"token operator\">&#061;<\/span><span class=\"token operator\">&lt;<\/span>VERSION_STRING<span class=\"token operator\">&gt;<\/span> docker-ce-cli<span class=\"token operator\">&#061;<\/span><span class=\"token operator\">&lt;<\/span>VERSION_STRING<span class=\"token operator\">&gt;<\/span> containerd.io<\/p>\n<p>\u5b89\u88c5\u6210\u529f<\/p>\n<p>$ <span class=\"token function\">sudo<\/span> docker run hello-world<\/p>\n<p>Hello from Docker<span class=\"token operator\">!<\/span><br \/>\nThis message shows that your installation appears to be working correctly.<\/p>\n<p>To generate this message, Docker took the following steps:<br \/>\n <span class=\"token number\">1<\/span>. The Docker client contacted the Docker daemon.<br \/>\n <span class=\"token number\">2<\/span>. The Docker daemon pulled the <span class=\"token string\">&#034;hello-world&#034;<\/span> image from the Docker Hub.<br \/>\n    <span class=\"token punctuation\">(<\/span>amd64<span class=\"token punctuation\">)<\/span><br \/>\n <span class=\"token number\">3<\/span>. The Docker daemon created a new container from that image <span class=\"token function\">which<\/span> runs the<br \/>\n    executable that produces the output you are currently reading.<br \/>\n <span class=\"token number\">4<\/span>. The Docker daemon streamed that output to the Docker client, <span class=\"token function\">which<\/span> sent it<br \/>\n    to your terminal.<\/p>\n<p>To try something <span class=\"token function\">more<\/span> ambitious, you can run an Ubuntu container with:<br \/>\n $ docker run -it ubuntu <span class=\"token function\">bash<\/span><\/p>\n<p>Share images, automate workflows, and <span class=\"token function\">more<\/span> with a <span class=\"token function\">free<\/span> Docker ID:<br \/>\n https:\/\/hub.docker.com\/<\/p>\n<p>For <span class=\"token function\">more<\/span> examples and ideas, visit:<br \/>\n https:\/\/docs.docker.com\/get-started\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.1k\u6b21\uff0c\u70b9\u8d5e11\u6b21\uff0c\u6536\u85cf15\u6b21\u3002Docker \u7684\u9694\u79bb\u673a\u5236\u901a\u8fc7\u3002<\/p>\n","protected":false},"author":2,"featured_media":37354,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[27,3230,121,188],"topic":[],"class_list":["post-37355","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-docker","tag-3230","tag-121","tag-188"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u300aDocker \u5165\u95e8\u4e0e\u8fdb\u9636\uff1a\u67b6\u6784\u5256\u6790\u3001\u9694\u79bb\u539f\u7406\u53ca\u5b89\u88c5\u5b9e\u64cd\u300b - \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\/37355.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u300aDocker \u5165\u95e8\u4e0e\u8fdb\u9636\uff1a\u67b6\u6784\u5256\u6790\u3001\u9694\u79bb\u539f\u7406\u53ca\u5b89\u88c5\u5b9e\u64cd\u300b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.1k\u6b21\uff0c\u70b9\u8d5e11\u6b21\uff0c\u6536\u85cf15\u6b21\u3002Docker \u7684\u9694\u79bb\u673a\u5236\u901a\u8fc7\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/37355.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-15T14:27:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250515142727-6825f9cfddbb6.png\" \/>\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=\"6 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/37355.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/37355.html\",\"name\":\"\u300aDocker \u5165\u95e8\u4e0e\u8fdb\u9636\uff1a\u67b6\u6784\u5256\u6790\u3001\u9694\u79bb\u539f\u7406\u53ca\u5b89\u88c5\u5b9e\u64cd\u300b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-05-15T14:27:29+00:00\",\"dateModified\":\"2025-05-15T14:27:29+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/37355.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/37355.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/37355.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u300aDocker \u5165\u95e8\u4e0e\u8fdb\u9636\uff1a\u67b6\u6784\u5256\u6790\u3001\u9694\u79bb\u539f\u7406\u53ca\u5b89\u88c5\u5b9e\u64cd\u300b\"}]},{\"@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":"\u300aDocker \u5165\u95e8\u4e0e\u8fdb\u9636\uff1a\u67b6\u6784\u5256\u6790\u3001\u9694\u79bb\u539f\u7406\u53ca\u5b89\u88c5\u5b9e\u64cd\u300b - \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\/37355.html","og_locale":"zh_CN","og_type":"article","og_title":"\u300aDocker \u5165\u95e8\u4e0e\u8fdb\u9636\uff1a\u67b6\u6784\u5256\u6790\u3001\u9694\u79bb\u539f\u7406\u53ca\u5b89\u88c5\u5b9e\u64cd\u300b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.1k\u6b21\uff0c\u70b9\u8d5e11\u6b21\uff0c\u6536\u85cf15\u6b21\u3002Docker \u7684\u9694\u79bb\u673a\u5236\u901a\u8fc7\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/37355.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-05-15T14:27:29+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250515142727-6825f9cfddbb6.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/37355.html","url":"https:\/\/www.wsisp.com\/helps\/37355.html","name":"\u300aDocker \u5165\u95e8\u4e0e\u8fdb\u9636\uff1a\u67b6\u6784\u5256\u6790\u3001\u9694\u79bb\u539f\u7406\u53ca\u5b89\u88c5\u5b9e\u64cd\u300b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-05-15T14:27:29+00:00","dateModified":"2025-05-15T14:27:29+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/37355.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/37355.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/37355.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u300aDocker \u5165\u95e8\u4e0e\u8fdb\u9636\uff1a\u67b6\u6784\u5256\u6790\u3001\u9694\u79bb\u539f\u7406\u53ca\u5b89\u88c5\u5b9e\u64cd\u300b"}]},{"@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\/37355","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=37355"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/37355\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/37354"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=37355"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=37355"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=37355"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=37355"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}