{"id":441958,"date":"2021-04-17T16:47:08","date_gmt":"2021-04-17T08:47:08","guid":{"rendered":"http:\/\/4563.org\/?p=441958"},"modified":"2021-04-17T16:47:08","modified_gmt":"2021-04-17T08:47:08","slug":"docker-%e5%ae%b9%e5%99%a8%e5%b7%b2%e5%90%af%e5%8a%a8%e5%b0%b1%e5%b4%a9%e6%ba%83%ef%bc%8c%e5%a6%82%e4%bd%95%e8%bf%9b%e5%85%a5%e8%b0%83%e8%af%95%ef%bc%9f","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=441958","title":{"rendered":"Docker \u5bb9\u5668\u5df2\u542f\u52a8\u5c31\u5d29\u6e83\uff0c\u5982\u4f55\u8fdb\u5165\u8c03\u8bd5\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  Docker \u5bb9\u5668\u5df2\u542f\u52a8\u5c31\u5d29\u6e83\uff0c\u5982\u4f55\u8fdb\u5165\u8c03\u8bd5\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : nyse <\/span>  <span><i><\/i> 2<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u4e00\u4e2a\u8fd0\u884c MySQL \u7684\u5bb9\u5668\uff0c\u7531\u4e8e\u64cd\u4f5c\u5931\u8bef\uff0c\u5bfc\u81f4\u4e00\u542f\u52a8\u5c31\u5d29\u6e83\u3002<\/p>\n<p>\u8fd0\u884c\u5bb9\u5668\u4e2d\u7684 bash \u63d0\u793a\u5bb9\u5668\u672a\u542f\u52a8\uff0c\u4f46\u662f\u5bb9\u5668\u6839\u672c\u5c31\u6ca1\u529e\u6cd5\u542f\u52a8\u3002<\/p>\n<p>\u6240\u4ee5\u8fd9\u79cd\u60c5\u51b5\u5982\u4f55\u8fdb\u5165\u5bb9\u5668\u64cd\u4f5c\uff1f<\/p>\n<p>\u6709\u4ec0\u4e48\u529e\u6cd5\u80fd\u628a\u5bb9\u5668\u4e2d\u7684\u6587\u4ef6\u590d\u5236\u51fa\u6765\u5417\uff1f<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>10<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"5757544\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : sniperking1234 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u542f\u52a8\u547d\u4ee4\u90a3\u91cc\u52a0\u4e2a sleep 3600                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5757545\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : momocraft <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8bd5\u8bd5 docker export<br \/>\u6216\u8005 docker inspect \u53ef\u4ee5\u770b\u5230\u5bb9\u5668\u5185\u6587\u4ef6\u7cfb\u7edf\u5728 host \u7684\u8def\u5f84                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5757546\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : momocraft <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5982\u679c\u4f60\u5728\u7528 docker-compose \u4e0d\u8981\u968f\u4fbf\u6539\u547d\u4ee4<br \/>\u5426\u5219\u53ef\u80fd\u521b\u5efa\u4e2a\u65b0\u7684\u5bb9\u5668 \u4e22\u5931\u4f60\u60f3\u4fdd\u7559\u7684\u6587\u4ef6                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5757547\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : BeautifulSoap <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u867d\u7136\u6839\u672c\u6ca1\u770b\u61c2 lz \u5230\u5e95\u9047\u5230\u4e86\u4ec0\u4e48\u95ee\u9898\uff08\u8fde\u9519\u8bef\u4fe1\u606f\u90fd\u6ca1\u6709\uff09\uff0c\u4f46\u662f\u901a\u8fc7\u522b\u7684\u65b9\u5f0f\u8bbf\u95ee\u5230\u5bb9\u5668\u5185\u7684\u6587\u4ef6\u8fd8\u662f\u6709\u975e\u5e38\u591a\u65b9\u6cd5\u7684\uff0c\u641c\u4e00\u4e0b\u5c31\u4e00\u5806<br \/>https:\/\/stackoverflow.com\/questions\/20813486\/exploring-docker-containers-file-system<\/p>\n<p>\u4ee5\u53ca\uff0c\u5bb9\u5668\u5d29\u4e86\u76f4\u63a5\u9500\u6bc1\u91cd\u542f\u4e0d\u5c31\u597d\u4e86\uff0c\u522b\u8bf4 lz \u4f60\u6240\u6709\u6570\u636e\u90fd\u6ca1\u6301\u4e45\u5316\u5168\u585e\u5bb9\u5668\u91cc\u3002\u3002\u3002\u3002\u3002\u3002\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5757548\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : yuanmomo <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5728\u547d\u4ee4\u884c\u7528 bash \u547d\u4ee4\u8986\u76d6 dockerfile \u91cc\u9762\u9ed8\u8ba4\u7684\u542f\u52a8\u547d\u4ee4\u3002<\/p>\n<p>\u6b63\u5e38\u5bb9\u5668\u542f\u52a8\u4e86\u8fc7\u540e\uff0c\u5728 bash \u6267\u884c\u76f8\u540c\u7684\u547d\u4ee4\u53bb\u6392\u67e5                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5757549\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Vegetable <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8986\u76d6\u542f\u52a8\u547d\u4ee4\uff0c\u8fdb\u5165\u5bb9\u5668\u624b\u52a8\u542f\u52a8 mysql\uff0c\u67e5\u770b\u65e5\u5fd7                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5757550\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : whileFalse <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             docker run -ti &#8211;entrypoint=&#8221;&#8221; \u4f60\u7684\u81ea\u5b9a\u4e49\u955c\u50cf sh<\/p>\n<p>\u7136\u540e\u6572\u547d\u4ee4\u542f\u52a8 mysql                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5757551\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : cheng6563 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u73b0\u6709\u5bb9\u5668\u5b58\u4e3a\u955c\u50cf\uff0c\u7136\u540e docker run -ti &#8211;entrypoint=&#8221;&#8221; IMAGE_ID sh                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5757552\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : killva4624 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e00\u4e2a\u662f\u770b\u770b\u4e0a\u4e2a\u5bb9\u5668\u51fa\u9519\u7684\u539f\u56e0\uff0c\u6bd4\u5982 mysql \u8fd9\u79cd\uff0c\u51fa\u9519\u65e5\u5fd7\u4f1a\u6253\u5728 stdout \u91cc\uff1b docker ps -a \u770b\u770b\u6240\u6709\u5bb9\u5668\u91cc\u521a\u542f\u52a8\u5c31\u5d29\u6e83\u7684\u5bb9\u5668\uff0c\u7136\u540e docker logs \u770b\u770b\u6709\u6ca1\u6709\u9519\u8bef\u8f93\u51fa\u3002<\/p>\n<p>\u53e6\u5916\u4e00\u4e2a\u65b9\u6cd5\u5c31\u662f\u8c03\u8bd5\uff0c\u5982\u4e0a\u9762\u7684\u5927\u4f6c\u4eec\u8bf4\u7684\uff0c\u7528 sleep xxxxx \u6216\u8005 ping 127.0.0.1 \u4f5c\u4e3a\u542f\u52a8\u547d\u4ee4\uff08 1 \u53f7\u8fdb\u7a0b\uff09\uff0c\u8ba9\u5bb9\u5668\u8dd1\u8d77\u6765\uff0c\u7136\u540e docker exec \u5230\u5bb9\u5668\u91cc\u624b\u52a8\u62c9\u8d77\u670d\u52a1\u770b\u770b\u62a5\u9519\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5757553\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : nyse <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u611f\u8c22\u5404\u4f4d\u5927\u4f6c\u63d0\u4f9b\u7684\u601d\u8def\uff0c\u73b0\u5728\u89e3\u51b3\u4e86\u3002<\/p>\n<p>\u6211\u7528\u7684\u662f docker-compose\uff0c\u901a\u8fc7\u5220\u9664 MySQL \u7684\u6570\u636e\u6587\u4ef6\uff0c\u91cd\u65b0\u521d\u59cb\u5316 MySQL\uff0c\u518d\u6062\u590d\u4e4b\u524d\u5907\u4efd\u7684\u6570\u636e\u5e93\u6587\u4ef6\u89e3\u51b3\u7684\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>Docker \u5bb9\u5668\u5df2\u542f\u52a8\u5c31\u5d29\u6e83\uff0c\u5982&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\/441958"}],"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=441958"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/441958\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=441958"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=441958"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=441958"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}