{"id":14259,"date":"2022-09-29T01:19:04","date_gmt":"2022-09-28T17:19:04","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=14259"},"modified":"2022-09-29T01:19:38","modified_gmt":"2022-09-28T17:19:38","slug":"docker-tours-1","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/docker-tours-1.html","title":{"rendered":"Docker\u5927\u884c\u5176\u9053\u2014\u521d\u8bc6"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u968f\u7740\u5206\u5e03\u5f0f\u3001\u4e91\u8ba1\u7b97\u3001\u5927\u6570\u636e\u7684\u706b\u70ed\u7206\u53d1\uff0c\u5927\u91cf\u7684\u4e91\u8ba1\u7b97\u96c6\u7fa4\u51fa\u73b0\uff0c\u5149\u51ed\u8ba1\u7b97\u673a\u786c\u4ef6\u914d\u7f6e\u7684\u5df2\u7ecf\u65e0\u6cd5\u518d\u6b21\u4e00\u8f83\u9ad8\u4e0b\uff0c\u865a\u62df\u5316\u6210\u4e3a\u5176\u4e2d\u6700\u6838\u5fc3\u7684\u6280\u672f\u3002\u865a\u62df\u5316\u65e2\u53ef\u4ee5\u901a\u8fc7\u786c\u4ef6\u6a21\u62df\uff0c\u4e5f\u53ef\u4ee5\u901a\u8fc7\u64cd\u4f5c\u7cfb\u7edf\u5c42\u9762\u53bb\u5b9e\u73b0\uff0c\u8fd1\u5e74\u6765\u70ed\u706b\u671d\u5929\u7684\u5bb9\u5668\u8f7b\u91cf\u7ea7\u865a\u62df\u5316\uff0c\u4fdd\u7559\u4e86\u64cd\u4f5c\u7cfb\u7edf\u672c\u8eab\u7684\u673a\u5236\u548c\u7279\u6027\uff0c\u800cDocker\u5728\u6b64\u8131\u9896\u800c\u51fa\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

 <\/p>\n

Docker\u7684\u524d\u4e16\u4eca\u751f<\/strong><\/div>\n

Docker\u662f\u57fa\u4e8eGo\u8bed\u8a00\u5b9e\u73b0\u7684\u4e91\u5f00\u6e90\u9879\u76ee\uff0c\u76ee\u524d\u5f52\u4e8eApache\u57fa\u91d1\u4f1a\u5e76\u9075\u5faaApache 2.0\u534f\u8bae\u3002\u8bde\u751f\u4e8e2013\u5e74\u521d\uff0c\u524d\u8eab\u516c\u53f8\u4e3adotCloud\uff0cdocker\u5f00\u6e90\u540e\u5f97\u5230\u53d7\u5230\u793e\u4f1a\u5e7f\u6cdb\u7684\u5173\u6ce8\uff0cdocker\u7684\u751f\u6001\u5708\u4f53\u7cfb\u4e5f\u9010\u6e10\u6210\u719f\uff0c\u8fd9\u5bb6\u516c\u53f8\u4e5f\u6539\u540d\u4e3aDocker Inc\uff0c\u4e13\u6ce8\u4e8eDocker\u76f8\u5173\u6280\u672f\u548c\u4ea7\u54c1\u5f00\u53d1\u3002<\/p>\n

Docker\u6700\u5927\u7684\u76ee\u6807\u662f\uff1a\u201cBuild, Ship and Run Any App, Anywhere\uff01\u201d\u3002\u4f60\u53ea\u9700\u8981\u901a\u8fc7\u5bf9\u5e94\u7528\u7ec4\u4ef6\u7684\u4e00\u6b21\u7684\u5c01\u88c5\uff0c\u5c31\u80fd\u5728\u4efb\u610f\u5730\u70b9\u6784\u5efa\u548c\u8fd0\u884c\u4f60\u7684\u5e94\u7528\u3002\u65e0\u8bba\u662f\u4e00\u4e2a\u5b8c\u6574\u7684\u5e94\u7528\uff0c\u6216\u8005\u662f\u67d0\u4e9b\u5fae\u670d\u52a1\uff0c\u751a\u81f3\u5230\u4e00\u4e2a\u5b8c\u6574\u7684\u64cd\u4f5c\u7cfb\u7edf\u90fd\u80fd\u6210\u4e3adocker\u7684\u5e94\u7528\u7ec4\u4ef6\u3002Docker\u63d0\u4f9b\u4e00\u4e2a\u9ad8\u6548\u3001\u654f\u6377\u548c\u8f7b\u91cf\u7684\u5bb9\u5668\u65b9\u6848\uff0c\u80fd\u52a8\u6001\u9002\u5e94\u5404\u79cd\u89c4\u6a21\u7684\u7cfb\u7edf\u90e8\u7f72\u9700\u6c42\u3002<\/p>\n

Docker\u6574\u4e2a\u751f\u547d\u5468\u671f\u5305\u542b\u4e09\u90e8\u5206\uff1a\u955c\u50cf\uff08Image\uff09\uff0c\u5bb9\u5668\uff08Container\uff09\uff0c\u4ed3\u5e93\uff08Repository\uff09\u3002\u955c\u50cf\u548c\u5bb9\u5668\u7684\u5173\u7cfb\u5c31\u50cf\u7a0b\u5e8f\u548c\u8fdb\u7a0b\uff0c\u955c\u50cf\u662f\u5bb9\u5668\u8fd0\u884c\u7684\u4e00\u5927\u524d\u63d0\uff0c\u800c\u5bb9\u5668\u5219\u662f\u955c\u50cf\u7684\u4e00\u4e2a\u8fd0\u884c\u5b9e\u4f8b\u3002\u4ed3\u5e93\u5219\u662f\u955c\u50cf\u7684\u7ba1\u7406\u4e2d\u5fc3\uff0c\u9ed8\u8ba4\u7684\u955c\u50cf\u4ed3\u5e93\u4e3aDocker Hub\u3002<\/p>\n

\"docker-frame\"<\/p>\n

Docker\u8fd0\u884c\u5bb9\u5668\u524d\u9700\u8981\u68c0\u67e5\u672c\u5730\u662f\u5426\u5b58\u5728\u5bf9\u5e94\u7684\u955c\u50cf\uff0c\u5982\u679c\u4e0d\u5b58\u5728\uff0c\u4f1a\u5c1d\u8bd5\u4ece\u9ed8\u8ba4\u7684\u955c\u50cf\u4ed3\u5e93\u4e0b\u8f7d\u3002\u955c\u50cf\u5b9e\u4f8b\u5316\u4e4b\u540e\u8fd0\u884c\u7740\u4e00\u4e2a\u5b8c\u6574\u7684\u5bb9\u5668\uff0c\u5bb9\u5668\u9664\u4e86\u955c\u50cf\u672c\u8eab\u7684\u5185\u5bb9\u5916\uff0c\u8fd8\u63d0\u4f9b\u989d\u5916\u7684\u53ef\u5199\u6587\u4ef6\u5c42\u4ee5\u53ca\u76f8\u5bf9\u72ec\u7acb\u7684\u8fd0\u884c\u73af\u5883\uff08\u53ef\u80fd\u662f\u4e00\u4e9b\u5e94\u7528\u6216\u8005\u670d\u52a1\uff0c\u4e5f\u53ef\u80fd\u662f\u5b8c\u6574\u7684\u64cd\u4f5c\u7cfb\u7edf\uff09\u3002<\/p>\n

\u4f5c\u4e3a\u4e00\u4e2aC\/S\u6a21\u578b\u7684\u9879\u76ee\uff0cDocker\u901a\u8fc7Docker Host\u8fdb\u884c\u955c\u50cf\u3001\u5bb9\u5668\u3001\u5b88\u62a4\u8fdb\u7a0b\u3001\u5206\u533a\u7b49\u7684\u7ba1\u7406\uff0c\u540c\u65f6\u5728Docker Client\u8fdb\u884c\u955c\u50cf\u7684\u62c9\u53d6\uff0c\u5bb9\u5668\u7684\u6784\u5efa\u7b49\u64cd\u4f5c\uff0c\u901a\u5e38\u60c5\u51b5\u4e0bHost\u548cClient\u53ef\u80fd\u4f1a\u5728\u540c\u4e00\u53f0\u673a\u5668\u4e0a\u3002<\/p>\n

Docker\u5f00\u6e90\u4ee3\u7801\u5730\u5740\uff1ahttps:\/\/github.com\/docker\/docker<\/a><\/p>\n

Docker\u5f97\u5929\u72ec\u539a\u7684\u4f18\u52bf<\/strong><\/div>\n
\u65b0\u7684\u90e8\u7f72\u65b9\u5f0f<\/strong><\/span><\/div>\n

\u5047\u5982\u5f53\u524d\u6709\u8fd9\u4e48\u4e00\u4e2a\u573a\u666f\uff1a\u201c\u7531\u4e8e\u4e1a\u52a1\u589e\u957f\uff0c\u516c\u53f8\u7684\u4e00\u4e2a\u7f51\u7ad9\u9879\u76ee\u9700\u8981\u8fc1\u79fb\u5230\u65b0\u7684\u670d\u52a1\u5668\u201d\u3002\u6309\u7167\u4f20\u7edf\u65b9\u6848\uff0c\u6211\u4eec\u5f88\u53ef\u80fd\u9700\u8981\u4f5c\u4e00\u4e9b\u91cd\u590d\u6027\u7684\u5de5\u4f5c\u3002\u9996\u5148\u9700\u8981\u5728\u65b0\u7684\u670d\u52a1\u5668\u4e0a\u5b89\u88c5\u5bf9\u5e94\u7684\u8fd0\u884c\u73af\u5883\u4ee5\u53ca\u5bf9\u5e94\u7684\u4f9d\u8d56\uff0c\u5982LAMP\uff08Linux+Apache+Mysql+PHP\uff09\uff0c\u521b\u5efa\u5bf9\u5e94\u7684\u7528\u6237\u6216\u7ec4\u5e76\u8fdb\u884c\u6587\u4ef6\u6743\u9650\u7684\u7ba1\u7406\uff0c\u8017\u8d39\u5927\u91cf\u7684\u7cbe\u529b\u540e\uff0c\u8fd8\u9700\u8981\u5bf9\u8be5\u73af\u5883\u8fdb\u884c\u6d4b\u8bd5\uff0c\u6700\u540e\u624d\u80fd\u90e8\u7f72\u4e0a\u7ebf\u3002\u8bd5\u60f3\u4e00\u4e0b\uff0c\u5982\u679c\u8fd9\u6837\u7684\u9700\u6c42\u591a\u5c11\u5341\u51e0\u500d\uff0c\u8fd9\u4e9b\u5de5\u4f5c\u9700\u8981\u91cd\u590d\u7684\u6267\u884c\u3002<\/p>\n

\u4e5f\u8bb8\u4f60\u4f1a\u8bf4\u53ef\u4ee5\u901a\u8fc7\u865a\u62df\u5316\u7684\u6280\u672f\u5c06\u6574\u4e2a\u73af\u5883\u6253\u5305\u6210\u955c\u50cf\u518d\u8fdb\u884c\u90e8\u7f72\uff0c\u52a0\u5165\u65b0\u7684\u670d\u52a1\u5668\u672c\u8eab\u4e5f\u662f\u4e00\u53f0\u865a\u62df\u5316\u7684\u673a\u5668\uff0c\u518d\u52a0\u4e0a\u4e00\u5c42xen\uff08\u6216\u8005\u5176\u4ed6\u865a\u62df\u673a\uff09\u53bb\u90e8\u7f72\u663e\u7136\u663e\u5f97\u591a\u4f59\u4e86\u3002<\/p>\n

\u800cDocker\u63d0\u4f9b\u4e00\u79cd\u6781\u4e3a\u7b80\u4fbf\u7684\u64cd\u4f5c\u65b9\u5f0f\uff0c\u901a\u8fc7\u5bb9\u5668\u6765\u8fdb\u884c\u5e94\u7528\u6253\u5305\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u5c01\u88c5\u6210\u955c\u50cf\u6216\u662f\u7f16\u5199Dockerfile\u7b49\u65b9\u5f0f\u6765\u8fdb\u884c\u6253\u5305\uff0c\u8fd9\u610f\u5473\u7740\u5728\u65b0\u7684\u670d\u52a1\u5668\u4e0a\u53ea\u9700\u8981\u542f\u52a8\u6240\u9700\u8981\u7684\u5bb9\u5668\u5373\u53ef\u3002\u4e00\u6765\u8282\u7701\u4e86\u5927\u91cf\u7684\u65f6\u95f4\u6295\u5165\uff0c\u800c\u6765\u964d\u4f4e\u4e86\u90e8\u7f72\u8fc7\u7a0b\u51fa\u73b0\u95ee\u9898\u5e26\u6765\u7684\u9690\u60a3\u3002<\/p>\n

\u8fd0\u7ef4\u7b56\u7565\u7684\u9769\u65b0<\/strong><\/span><\/div>\n

1. \u6781\u901f\u4ea4\u4ed8\u548c\u90e8\u7f72<\/p>\n

\u4f7f\u7528docker\uff0c\u5f00\u53d1\u4eba\u5458\u53ef\u4ee5\u4f7f\u7528\u955c\u50cf\u5feb\u901f\u6784\u5efa\u4e00\u5957\u6807\u51c6\u7684\u5f00\u53d1\u73af\u5883\u3002\u4e4b\u540e\u7684\u6d4b\u8bd5\u548c\u4e0a\u7ebf\u73af\u8282\u5b8c\u5168\u53ef\u4ee5\u590d\u7528\u8fd9\u5957\u955c\u50cf\u5c06\u5e94\u7528\u90e8\u7f72\u5230\u6d4b\u8bd5\u73af\u5883\u6216\u751f\u4ea7\u73af\u5883\u7b49\u4efb\u610f\u5730\u65b9\u3002Docker\u53ef\u4ee5\u5feb\u901f\u521b\u5efa\u3001\u5220\u9664\u5bb9\u5668\uff0c\u5e76\u4fdd\u7559\u4e86\u6bcf\u4e00\u4e2a\u6b65\u9aa4\u7684\u914d\u7f6e\u548c\u64cd\u4f5c\u8fc7\u7a0b\uff0c\u964d\u4f4e\u5f00\u53d1\u3001\u6d4b\u8bd5\u3001\u90e8\u7f72\u7684\u65f6\u95f4\u7684\u540c\u65f6\u8ba9\u73af\u5883\u90e8\u7f72\u66f4\u5bb9\u6613\u88ab\u7406\u89e3\u3002\u901a\u8fc7\u7b80\u5355\u7684\u914d\u7f6e\u6587\u4ef6\u4fee\u6539\uff0c\u5c31\u80fd\u8f7b\u677e\u5b8c\u6210\u4e00\u6b21\u8fd0\u884c\u73af\u5883\u7684\u8fed\u4ee3\uff0c\u6240\u6709\u64cd\u4f5c\u90fd\u53ef\u4ee5\u4ee5\u589e\u91cf\u7684\u5f62\u5f0f\u8fdb\u884c\u5206\u53d1\u548c\u66f4\u65b0\uff0c\u4ece\u800c\u5b9e\u73b0\u81ea\u52a8\u5316\u548c\u9ad8\u6548\u7684\u5bb9\u5668\u7ba1\u7406\u3002<\/p>\n

2. \u6027\u80fd\u635f\u8017\u4f4e<\/p>\n

\u4e8b\u5b9e\u4e0adocker\u662f\u5185\u6838\u7ea7\u522b\u7684\u865a\u62df\u5316\uff0c\u4e0d\u9700\u8981\u989d\u5916\u7684\u865a\u62df\u5316\u7ba1\u7406\u7a0b\u5e8f\uff0c\u56e0\u6b64\u5f00\u542fdocker\u5bf9\u6027\u80fd\u7684\u635f\u8017\u51e0\u4e4e\u5ffd\u7565\u4e0d\u8ba1\u3002<\/p>\n

3. \u8f7b\u4fbf\u6613\u8fc1\u79fb\u62d3\u5c55<\/p>\n

Docker\u51e0\u4e4e\u652f\u6301\u4efb\u610f\u5e73\u53f0\u8fd0\u884c\uff0c\u65e0\u8bba\u662f\u7269\u7406\u673a\u8fd8\u662f\u865a\u62df\u5316\u7684\u4e3b\u673a\uff0c\u751a\u81f3\u4e2a\u4eba\u7535\u8111\u90fd\u80fd\u517c\u5bb9\u8fd0\u884cdocker\uff0c\u8fd9\u79cd\u517c\u5bb9\u6027\u53ef\u4ee5\u8ba9\u5e94\u7528\u66f4\u65b9\u4fbf\u5207\u6362\u8fd0\u884c\u5e73\u53f0\u3002<\/p>\n

4. \u89c4\u8303\u5316\u7684\u6807\u51c6<\/p>\n

Docker\u80cc\u540e\u7684\u6807\u51c6\u5316\u5bb9\u5668\u6267\u884c\u5f15\u64ce - runC\u3002runC\u662f\u7531docker\u8d21\u732e\u540e\u7eed\u5b8c\u5584\u7684\u4e00\u4e2a\u5f00\u653e\u7684\u5de5\u4e1a\u5316\u6807\u51c6\uff0c\u5176\u4e3b\u8981\u5185\u5bb9\uff1a<\/p>\n