{"id":438718,"date":"2021-04-16T02:30:43","date_gmt":"2021-04-15T18:30:43","guid":{"rendered":"http:\/\/4563.org\/?p=438718"},"modified":"2021-04-16T02:30:43","modified_gmt":"2021-04-15T18:30:43","slug":"%e8%af%b7%e6%95%99%e5%85%b3%e4%ba%8e%e5%9f%ba%e4%ba%8e-docker-%e5%bc%80%e5%8f%91%e7%9a%84%e4%b8%80%e4%b8%aa%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=438718","title":{"rendered":"\u8bf7\u6559\u5173\u4e8e\u57fa\u4e8e docker \u5f00\u53d1\u7684\u4e00\u4e2a\u95ee\u9898"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u8bf7\u6559\u5173\u4e8e\u57fa\u4e8e docker \u5f00\u53d1\u7684\u4e00\u4e2a\u95ee\u9898               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : zxCoder <\/span>  <span><i><\/i> 0<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u6211\u73b0\u5728\u6709\u4e00\u4e2a docker \u955c\u50cf\uff0c\u91cc\u9762\u88c5\u4e86\u4e00\u4e9b\u57fa\u7840\u5de5\u5177\uff0c\u7136\u540e\u6211\u7684\u4ee3\u7801\u662f\u9700\u8981\u7528\u5230\u8fd9\u4e2a\u73af\u5883\uff0c\u6bd4\u5982\u4ee3\u7801\u91cc\u5199<code>subprocess.run([\"ls\", \"-l\", \"\/dev\/null\"])<\/code>\u6267\u884c\u4e00\u4e9b\u8fd9\u4e2a\u73af\u5883\u7684\u547d\u4ee4\uff0c\u7136\u540e\u518d\u628a\u6211\u7684\u4ee3\u7801\u57fa\u4e8e\u8fd9\u4e2a\u955c\u50cf\u518d\u6253\u5305\u6210\u4e00\u4e2a\u65b0\u7684\u955c\u50cf\u3002<\/p>\n<p>\u8fd9\u4e2a\u505a\u6cd5\u5408\u7406\u5417\uff1f\u6211\u5728\u5f00\u53d1\u7684\u65f6\u5019\u5e94\u8be5\u600e\u4e48\u505a\u5462\uff1f<\/p>\n<p>\u662f\u4e0d\u7ba1\u8fd9\u4e2a\u955c\u50cf\uff0c\u76f4\u63a5\u5728\u672c\u5730\u88c5\u597d\u8fd9\u4e9b\u73af\u5883\uff0c\u7136\u540e\u6253\u5305\u7684\u65f6\u5019\u518d\u57fa\u4e8e\u8fd9\u4e2a\u955c\u50cf\u6253\u5305\u5462\uff1f<\/p>\n<p>\u8fd8\u662f\u53ef\u4ee5\u600e\u4e48\u5229\u7528\u4e0a\u8fd9\u4e2a\u955c\u50cf\uff0c\u542f\u52a8\u4e2a\u5bb9\u5668\u518d\u8fde\u63a5\u4e0a\u53bb\u611f\u89c9\u4e5f\u4e0d\u592a\u597d\uff0c\u5230\u65f6\u5019\u6253\u5305\u8fd8\u5f97\u6539\u4ee3\u7801\u5427\uff1f<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>11<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"5750700\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : binux <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5f53\u7136\u53ef\u4ee5\u4e86\uff0c\u6211\u4e5f\u6ca1\u89c1\u8c01 FROM scratch \u5efa\u4e00\u4e2a\u955c\u50cf\u554a                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5750701\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : k9982874 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5408\u7406\uff0cdocker \u4e5f\u6709\u65b9\u6848\u3002google docker multi stage build                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5750702\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : hanxiV2EX <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u57fa\u7840\u955c\u50cf\u53ef\u4ee5\u63a8\u5230 hub \u4e0a\u53bb                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5750703\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : hanxiV2EX <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4f46\u662f\u4e00\u822c\u4e3a\u4e86\u4fdd\u6301\u5f88\u5c0f\u955c\u50cf\u7684\uff0c\u90fd\u4f1a\u7528\u4e0a\u8bf4\u7684\u591a\u4e2a stage \u6765\u5199 dockerfile \u7684\uff0c\u533a\u5206\u7f16\u8bd1\u9636\u6bb5\u548c\u8fd0\u884c\u9636\u6bb5\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5750704\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : zxCoder <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @hanxiV2EX \u4f46\u6211\u8fd8\u662f\u6ca1\u61c2\u672c\u5730\u5f00\u53d1\u8981\u600e\u4e48\u505a&#8230;                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5750705\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : shm7 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4ee5 docker \u57fa\u7840\u955c\u50cf \u4e3a\u57fa\u7840\uff0c\u6dfb\u52a0\u81ea\u5df1\u7684\u7ec4\u4ef6\u548c\u4ee3\u7801\uff0c\u5236\u6210\u81ea\u5df1\u7684\u955c\u50cf\uff0c\u662f\u57fa\u672c\u64cd\u4f5c\u3002\u6ca1\u542c\u8bf4\u8fc7\u8fd9\u65b9\u9762\u7684\u6cd5\u5f8b\u95ee\u9898\uff0c\u5982\u679c\u6709\u8fd9\u4e2a\u57fa\u7840\u955c\u50cf\u7684\u5236\u4f5c\u8005\u4f1a\u4e13\u95e8\u8bf4\u660e\uff0c\u4f60\u53bb\u627e\u627e\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5750706\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : psyer <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @hanxiV2EX \u597d\u5bb6\u4f19\uff0c\u641c\u4e86\u4e00\u4e0b multi stage\uff0c\u611f\u89c9\u5f88\u4e0d\u9519\u3002\u6211\u6709\u4e2a\u9ad8\u53ef\u7528 Hadoop HBase HA \u955c\u50cf\u672c\u5730 1.5G \u5de6\u53f3\uff0c\u4e0d\u8fc7\u4ed3\u5e93\u663e\u793a\u624d 500 \u591a M\uff0c\u662f\u771f\u7684\u5927\u5927\u5927\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5750707\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : SjwNo1 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e34\u65f6\u5c31\u8d77\u4e2a\u57fa\u7840\u955c\u50cf exec \u8fdb\u53bb\u5f00\u53d1<br \/>\u5426\u5219\u751a\u81f3\u53ef\u4ee5 commit \u6253\u4e00\u4e2a\u65b0\u955c\u50cf                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5750708\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : hanxiV2EX <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @zxCoder \u5c31\u662f\u5199 dockerfile \u5440                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5750709\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : zxCoder <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @hanxiV2EX dockerfile \u4e0d\u662f\u6253\u5305\u90e8\u7f72\u7684\u65f6\u5019\u7528\u5417                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5750710\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : hanxiV2EX <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @zxCoder \u672c\u5730\u7528 dockerfile \u914d\u5408 docker-composer \u53ef\u4ee5\u5f88\u65b9\u4fbf\u7684\u7ba1\u7406                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u8bf7\u6559\u5173\u4e8e\u57fa\u4e8e docker \u5f00\u53d1\u7684&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/438718"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=438718"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/438718\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=438718"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=438718"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=438718"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}