{"id":198286,"date":"2020-11-09T13:38:08","date_gmt":"2020-11-09T05:38:08","guid":{"rendered":"http:\/\/4563.org\/?p=198286"},"modified":"2020-11-09T13:38:08","modified_gmt":"2020-11-09T05:38:08","slug":"macos-%e6%80%8e%e4%b9%88%e8%ae%be%e7%bd%ae-docker-%e4%b8%8a%e7%9a%84%e5%ae%b9%e5%99%a8%e4%bd%bf%e7%94%a8%e5%ae%bf%e4%b8%bb%e6%9c%ba%e4%b8%8a%e7%9a%84-http-%e4%bb%a3%e7%90%86","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=198286","title":{"rendered":"macos \u600e\u4e48\u8bbe\u7f6e docker \u4e0a\u7684\u5bb9\u5668\u4f7f\u7528\u5bbf\u4e3b\u673a\u4e0a\u7684 http \u4ee3\u7406?"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  macos \u600e\u4e48\u8bbe\u7f6e docker \u4e0a\u7684\u5bb9\u5668\u4f7f\u7528\u5bbf\u4e3b\u673a\u4e0a\u7684 http \u4ee3\u7406?               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : b0644170fc <\/span>  <span><i><\/i> 4<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u6211\u770b\u5b98\u65b9\u624b\u518c\u8bf4\u4f7f\u7528 -e\uff0c\u6211\u7684\u542f\u52a8\u547d\u4ee4\u7247\u6bb5\u5982\u4e0b<\/p>\n<pre><code>-e HTTP_PROXY=http:\/\/host.docker.internal:6152 <\/code><\/pre>\n<p>\u4e0d\u7ba1\u662f<code>host.docker.internal<\/code>,\u8fd8\u662f <code>127.0.0.1<\/code> \u90fd\u4e0d\u8d77\u4f5c\u7528<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>9<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4244532\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Tink <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             mac \u4e0d\u77e5\u9053\uff0c\u4f46\u662f linux \u4f60\u53ef\u4ee5 ifconfig \u67e5\u770b\u7f51\u5361\uff0c\u627e\u5230 docker0 \u90a3\u4e2a IP\uff0c\u5b83\u8ddf\u4f60\u7684\u5bb9\u5668\u662f\u5728\u4e00\u4e2a\u7f51\u6bb5\u7684                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4244533\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : gqbre <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8bd5\u8bd5\u4e0a\u7684\u65b9\u6cd5\uff0c\u4e0d\u7136\u5c31\u76f2\u8bd5 172.17.0.1 ?                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4244534\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : mrjnamei <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             preference &gt; proxies \u8bbe\u7f6e\uff0c<br \/>\u8bbe\u7f6e\u5b8c\u4e86\u91cd\u542f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4244535\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : b0644170fc <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @mrjnamei \u8fd9\u4e2a\u53ea\u80fd\u4f5c\u7528\u4e0e\u62c9\u53d6 \/\u4e0a\u4f20\u955c\u50cf\u624d\u6709\u7528\u5427\u3002\u5bf9\u4e8e\u8fd0\u884c\u4e2d\u7684\u5bb9\u5668\u4e0d\u8d77\u4f5c\u7528                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4244536\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : loushizan <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             docker run &#8211;net=host \u4f7f\u7528\u4e3b\u673a\u7684\u7f51\u7edc                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4244537\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Kobayashi <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u73af\u5883\u53d8\u91cf HTTP_PROXY \u6ca1\u7528\u7684\uff0cmacOS \u4e0a docker \u5b9e\u73b0\u548c Linux \u4e0b\u4e0d\u4e00\u6837\uff1a\u5bbf\u4e3b\u4e0d\u5728\u5bb9\u5668\u6240\u5728\u7684\u7f51\u7edc\u91cc\uff0c\u4e5f\u5c31\u662f\u8bf4\u4ed6\u4eec\u4e0d\u4e92\u901a\u3002\u5728 Linux \u4e0b docker \u6ca1\u6709\u8fd9\u79cd\u95ee\u9898\u3002\u5efa\u8bae\u4f7f\u7528\u5e26 Tap\/TUN \u7684\u589e\u5f3a\u4ee3\u7406\u6a21\u5f0f\uff0c\u5982 clashx pro, proxifier, surge\uff0c\u8fd9\u6837\u76f4\u63a5\u5728\u5bbf\u4e3b\u673a\u4e0a\u4ee3\u7406\u4e86 com.docker.vpnkit \u8fdb\u7a0b\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4244538\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : foMM <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4ece docker \u8bbf\u95ee\u4e3b\u673a\uff0chost \u662f docker.for.mac.localhost                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4244539\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : b0644170fc <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @loushizan \u8fd9\u4e2a\u4e5f\u6ca1\u7528\u5427\u3002\u5b98\u7f51\u4e0a\u6709\u660e\u786e\u8bf4\u660e \u4e3b\u673a\u7f51\u7edc\u4e0d\u9002\u7528\u4e8e macos \u548c windows.<\/p>\n<p>https:\/\/docs.docker.com\/network\/host\/                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4244540\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Kobayashi <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @b0644170fc host \u4e0d\u5927\u786e\u5b9a\uff0c\u6211\u4e0a\u8fb9\u8bf4\u7684\u662f bridge \u7684\u60c5\u51b5\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>macos \u600e\u4e48\u8bbe\u7f6e docker&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\/198286"}],"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=198286"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/198286\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=198286"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=198286"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=198286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}