<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>kuronekopunk</author_name>
  <author_url>https://blog.hatena.ne.jp/kuronekopunk/</author_url>
  <blog_title>ノンカフェインであなたにやさしい</blog_title>
  <blog_url>https://akinobu.net/</blog_url>
  <categories>
  </categories>
  <description>Dockerで立てたコンテナ内から別コンテナに接続したかったのですが、ネットワークが別になるのでコンテナ名では繋げられず困っていました。 例えばコンテナAでDBを立ち上げていて、コンテナBからDBに接続したいなど。 考えを変えて、ホスト側にさえアクセスできれば勝手にルーティングされると思い、Dockerコンテナ内からホスト側にアクセスする方法を探したところ host.docker.internal でホスト側にアクセスできるよう。 なのでコンテナB側の接続情報を host.docker.internal:3306 とすることでアクセスができました。 こちらの記事を参考にしました。 uepon.…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fakinobu.net%2Fentry%2F2022%2F03%2F29%2F101701&quot; title=&quot;Dockerコンテナ内からホスト側にアクセスする方法 - ノンカフェインであなたにやさしい&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2022-03-29 10:17:01</published>
  <title>Dockerコンテナ内からホスト側にアクセスする方法</title>
  <type>rich</type>
  <url>https://akinobu.net/entry/2022/03/29/101701</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
