{"id":3933,"date":"2021-05-08T16:25:36","date_gmt":"2021-05-08T07:25:36","guid":{"rendered":"https:\/\/tech.akat.info\/?p=3933"},"modified":"2021-05-08T20:00:41","modified_gmt":"2021-05-08T11:00:41","slug":"%e3%82%b3%e3%83%b3%e3%83%86%e3%83%8a%e5%90%8d%e3%81%a7%e3%82%b3%e3%83%b3%e3%83%86%e3%83%8a%e9%96%93%e9%80%9a%e4%bf%a1%e3%81%97%e3%81%9f%e3%81%84%e5%a0%b4%e5%90%88%e3%81%af%e3%80%81%e3%83%8d%e3%83%83","status":"publish","type":"post","link":"https:\/\/tech.akat.info\/?p=3933","title":{"rendered":"\u30b3\u30f3\u30c6\u30ca\u540d\u3067\u30b3\u30f3\u30c6\u30ca\u9593\u901a\u4fe1\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30d6\u30ea\u30c3\u30b8\u3092\u65b0\u305f\u306b\u4f5c\u6210\u3059\u308b\u3079\u3057"},"content":{"rendered":"<h2>\u7d50\u8ad6<\/h2>\n<p>docker run \u306e\u969b\u306b network \u3092\u6307\u5b9a\u3057\u306a\u3051\u308c\u3070\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30d6\u30ea\u30c3\u30b8\u304c\u5229\u7528\u3055\u308c\u3001\u30b3\u30f3\u30c6\u30ca\u540d\u306f\u540d\u524d\u89e3\u6c7a\u3067\u304d\u306a\u3044\u3002<br \/>\n(IP\u30a2\u30c9\u30ec\u30b9\u3067\u30b3\u30f3\u30c6\u30ca\u9593\u901a\u4fe1\u306f\u53ef\u80fd)<br \/>\n\u30b3\u30f3\u30c6\u30ca\u540d\u3067\u30b3\u30f3\u30c6\u30ca\u9593\u901a\u4fe1\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30d6\u30ea\u30c3\u30b8\u3092\u65b0\u305f\u306b\u4f5c\u6210\u3057\u3066\u3001docker run \u306e\u969b\u306b\u6307\u5b9a\u3059\u308b\u3053\u3068\u3002<br \/>\n\u305d\u3046\u3059\u308b\u3053\u3068\u3067\u30b3\u30f3\u30c6\u30ca\u304c\u5185\u90e8DNS\u30b5\u30fc\u30d0(127.0.0.11)\u3092\u5229\u7528\u3059\u308b\u305f\u3081\u3001\u30b3\u30f3\u30c6\u30ca\u540d\u306e\u540d\u524d\u89e3\u6c7a\u304c\u53ef\u80fd\u3068\u306a\u308b\u3002<\/p>\n<h2>\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30d6\u30ea\u30c3\u30b8\u3092\u5229\u7528\u3059\u308b\u5834\u5408<\/h2>\n<p>\u30c7\u30d5\u30a9\u30eb\u30c8\u3067 bridge \u304c\u5229\u7528\u3055\u308c\u308b\u3002alpine\u3092\u8d77\u52d5\u3059\u308b\u3068docker\u30db\u30b9\u30c8\u3068\u540c\u3058DNS\u30b5\u30fc\u30d0\u304c\u6307\u5b9a\u3055\u308c\u308b\u305f\u3081\u3001\u30b3\u30f3\u30c6\u30ca\u540d\u306f\u540d\u524d\u89e3\u6c7a\u3067\u304d\u306a\u3044\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n# docker network ls\r\nNETWORK ID     NAME      DRIVER    SCOPE\r\n4a91590dd285   bridge    bridge    local\r\nc34d47cfe560   host      host      local\r\nf327d234d944   none      null      local\r\n\r\n# docker run -it alpine \/bin\/sh\r\n\r\n\/ # cat \/etc\/resolv.conf\r\nnameserver 210.188.224.10\r\nnameserver 210.188.224.11\r\nsearch localdomain\r\n<\/pre>\n<h2>\u81ea\u4f5c\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30d6\u30ea\u30c3\u30b8\u3092\u5229\u7528\u3059\u308b\u5834\u5408<\/h2>\n<p>n0\u3092\u4f5c\u6210\u3057\u3066\u5229\u7528\u3059\u308b\u3068\u3001DNS\u30b5\u30fc\u30d0\u306f\u5185\u90e8DNS\u30b5\u30fc\u30d0(127.0.0.11)\u3092\u5229\u7528\u3057\u3066\u304a\u308a\u3001\u30b3\u30f3\u30c6\u30ca\u540d\u3092\u540d\u524d\u89e3\u6c7a\u3057\u3066\u3044\u308b\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n# docker network create n0\r\n# docker network ls\r\nNETWORK ID     NAME      DRIVER    SCOPE\r\n4a91590dd285   bridge    bridge    local\r\nc34d47cfe560   host      host      local\r\nb514e2c38fb3   n0        bridge    local\r\nf327d234d944   none      null      local\r\n\r\n# docker run -itd --name test1 --network n0 alpine \/bin\/sh\r\n# docker run -it --name test2 --network n0 alpine \/bin\/sh\r\n\r\n\/ # cat \/etc\/resolv.conf\r\nsearch localdomain\r\nnameserver 127.0.0.11\r\noptions edns0 ndots:0\r\n\r\n\/ # nslookup -type=A test1 127.0.0.11\r\nServer:         127.0.0.11\r\nAddress:        127.0.0.11:53\r\n\r\nNon-authoritative answer:\r\nName:   test1\r\nAddress: 192.168.2.2\r\n\r\n# ping -c 1 test1\r\nPING test1 (192.168.2.2): 56 data bytes\r\n64 bytes from 192.168.2.2: seq=0 ttl=64 time=0.120 ms\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u7d50\u8ad6 docker run \u306e\u969b\u306b network \u3092\u6307\u5b9a\u3057\u306a\u3051\u308c\u3070\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30d6\u30ea\u30c3\u30b8\u304c\u5229\u7528\u3055\u308c\u3001\u30b3\u30f3\u30c6\u30ca\u540d\u306f\u540d\u524d\u89e3\u6c7a\u3067\u304d\u306a\u3044\u3002 (IP\u30a2\u30c9\u30ec\u30b9\u3067\u30b3\u30f3\u30c6\u30ca\u9593\u901a\u4fe1\u306f\u53ef\u80fd) \u30b3\u30f3\u30c6\u30ca\u540d\u3067\u30b3\u30f3\u30c6\u30ca\u9593\u901a\u4fe1\u3057\u305f\u3044\u5834 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[72],"tags":[],"_links":{"self":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts\/3933"}],"collection":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3933"}],"version-history":[{"count":5,"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts\/3933\/revisions"}],"predecessor-version":[{"id":3938,"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts\/3933\/revisions\/3938"}],"wp:attachment":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3933"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3933"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3933"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}