{"id":779,"date":"2019-11-26T15:54:57","date_gmt":"2019-11-26T07:54:57","guid":{"rendered":"https:\/\/www.zhuyanbin.com\/?p=779"},"modified":"2019-11-26T15:54:57","modified_gmt":"2019-11-26T07:54:57","slug":"i-want-to-connect-from-a-container-to-a-service-on-the-host","status":"publish","type":"post","link":"https:\/\/www.yanbin888.com\/?p=779","title":{"rendered":"I WANT TO CONNECT FROM A CONTAINER TO A SERVICE ON THE HOST"},"content":{"rendered":"\n<p>The host has a changing IP address (or none if you have no network access). From 18.03 onwards our recommendation is to connect to the special DNS name&nbsp;<code>host.docker.internal<\/code>, which resolves to the internal IP address used by the host. This is for development purpose and will not work in a production environment outside of Docker Desktop for Mac.<\/p>\n\n\n\n<p>The gateway is also reachable as&nbsp;<code>gateway.docker.internal<\/code>.<\/p>\n\n\n\n<p>link: https:\/\/docs.docker.com\/docker-for-mac\/networking\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The host has a changing IP address (or none if you have <span class=\"ellipsis\">&hellip;<\/span> <span class=\"more-link-wrap\"><a href=\"https:\/\/www.yanbin888.com\/?p=779\" class=\"more-link\"><span>Read More &rarr;<\/span><\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[54,1],"tags":[53,6],"class_list":["post-779","post","type-post","status-publish","format-standard","hentry","category-docker","category-mac","tag-docker","tag-mac-os-x"],"_links":{"self":[{"href":"https:\/\/www.yanbin888.com\/index.php?rest_route=\/wp\/v2\/posts\/779","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yanbin888.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yanbin888.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yanbin888.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yanbin888.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=779"}],"version-history":[{"count":1,"href":"https:\/\/www.yanbin888.com\/index.php?rest_route=\/wp\/v2\/posts\/779\/revisions"}],"predecessor-version":[{"id":780,"href":"https:\/\/www.yanbin888.com\/index.php?rest_route=\/wp\/v2\/posts\/779\/revisions\/780"}],"wp:attachment":[{"href":"https:\/\/www.yanbin888.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=779"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yanbin888.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=779"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yanbin888.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=779"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}