title: Gradle docker image can't connect to mysql testcontainer
body: <p>I have a small integration test that uses MySQL Test container.</p>
  
  <p>When I build locally, running the simple gradlew build command, it runs, test and builds the project. But when I try to use the official gradle docker image, the test stalls waiting for the availability of the mysql database.</p>
  
  <p>When my build runs, it creates 3 containers:</p>
  
  <ul>
  <li>Gradle Container</li>
  <li>quay.io/testcontainers/ryuk:0.2.3</li>
  <li>mysql:latest</li>
  </ul>
  
  <p>My gradle image is different from the official one, because it has docker installed:</p>
  
  <pre><code>FROM gradle
  USER root
  RUN apt-get update &amp;&amp; \
      apt-get install -y \
      apt-transport-https \
      ca-certificates \
      curl \
      gnupg2 \
      software-properties-common &amp;&amp; \
      curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - &amp;&amp; \
      apt-key fingerprint 0EBFCD88 &amp;&amp; \
      add-apt-repository \
          "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
          $(lsb_release -cs) \
          stable" &amp;&amp; \
      apt-get update &amp;&amp; \
      apt-get install -y docker-ce docker-ce-cli containerd.io 
  </code></pre>
  
  <p>When the connection was stalled, I connected to the gradle image, and I installed the mysql client. I tried to connect to the same image the tests are being connected and I had no problem to connect.
  Does anyone has any idea on what I'm doing wrong, since only running the build inside the container I have this problem?</p>
  
  <p>I run with this:</p>
  
  <pre><code>docker container run -v /var/run/docker.sock:/var/run/docker.sock -v &lt;local repo&gt;:/home/gradle/project -w /home/gradle/project --rm mygradle gradle build -i
  </code></pre>
  
  <p>Edit:
  This is not because of the gradle docker image, but any image. If I run using the Jenkins, and it being a container, this doesn't work also. Tries to connect to the 172.x.x.1 (host address) and the port exposed and the Test doesn't connect, but accessing the container, and trying the same exact connection using the mysql client, I can connect.</p>