title: Calling one docker from another docker encountered connection refused
body: <p>I am using kubernetes (by windows 10 - docker desktop).</p>
  <p>I am using mysql, that is running by helm 3 (loaded from bitnami repository).</p>
  <p>I am creating another application.
  For now, I am testing on docker (not in kubernetes yet).</p>
  <p>Everything is fine, but when trying to connect the database from my project
  (BTW - Project works fine, but not when running on docker).</p>
  <p>Something like:</p>
  <pre><code>docker run --name test-docker --rm my-image:tag --db &quot;root:12345@tcp(127.0.0.1:3306)/test&quot; 
  </code></pre>
  <p>(db is a parameter to to connect to db).</p>
  <p>I get the message:</p>
  <pre><code>2022-02-21T12:18:17.205Z        FATAL   failed to open db: could not setup schema: cannot create jobs table: dial tcp 127.0.0.1:3306: connect: connection refused
  </code></pre>
  <p>I have investigate a little, and find that the problem may be because the dockers running need to run on the same network.
  (Nonetheless, they are actually dockers, when one is running by helm tool for K8S).</p>
  <p>this is on:
  <a href="https://www.digitalocean.com/community/tutorials/how-to-inspect-kubernetes-networking" rel="nofollow noreferrer">kubernetes networking</a></p>
  <p>When I run:</p>
  <pre><code>nsenter -t your-container-pid -n ip addr
  </code></pre>
  <p>the pid is not directory, so I get the message:</p>
  <pre><code>/proc/&lt;pid&gt;/ns/net - No such file or directory
  </code></pre>
  <p>How can I eventually run my project that can use the mysql (running in dockers on K8S)?</p>
  <p>Thanks.</p>