title: Cannot access Jenkins docker container from another docker container
body: <p>I have two local docker containers: Jenkins, and Bitbucket. I cannot seem to make http requests from Bitbucket to Jenkins. However, I can make requests from Jenkins to Bitbucket.</p>
  <p>The containers were ran as such:</p>
  <p><strong>Bitbucket:</strong></p>
  <pre><code>docker run -v bitbucketVolume:/var/atlassian/application-data/bitbucket --name=&quot;bitbucket&quot; -d --add-host host.docker.internal:host-gateway -p 7990:7990 -p 7999:7999 atlassian/bitbucket-server 
  </code></pre>
  <p><strong>Jenkins:</strong></p>
  <pre><code>docker run --name=jenkins -d --add-host host.docker.internal:host-gateway -v jenkins_home:/var/jenkins_home  -p 9080:8080 -p 50000:50000 jenkins/jenkins:latest
  </code></pre>
  <p>For simplicity and demonstration purposes I will use the curl command to exemplify the behaviour.</p>
  <p>Making a request from <strong>Jenkins to Bitbucket</strong>, will get the expected result when invoking curl to the Bitbucket container:</p>
  <pre><code>jenkins@c1f0ec99a73a:/$ curl -v host.docker.internal:7990
  *   Trying 172.17.0.1:7990...
  * Connected to host.docker.internal (172.17.0.1) port 7990 (#0)
  </code></pre>
  <p>If it's the other way around, from <strong>Bitbucket to Jenkins</strong>,  It will not succeed:</p>
  <pre><code>root@2a350f4d1ff4:/var/atlassian/application-data/bitbucket# curl -v host.docker.internal:8080
  * Could not resolve host: host.docker.internal
  * Closing connection 0
  curl: (6) Could not resolve host: host.docker.internal
  </code></pre>
  <p><strong>Question:</strong> what configuration am I missing to be able to comunicate from the Bitbucket container to the Jenkins one?</p>