title: Testcontainers ; Running @Testcontainers Tests inside docker [Running Docker inside Docker]
body: <p>How To Run <code>@Testcontainers</code> based test cases inside the docker container ? </p>
  
  <p>I have Simple Spring Boot App that has Integration Test (Component level) that are interacting  with containers using <code>Testcontainers</code>. Test cases are ruining fine from outside container(Local machine).</p>
  
  <p>We are running everything in containers and build is running on docker jenkins image. 
  Docker file is creating jar and then image. <code>@Testcontainers</code> is not able to find docker installed. 
  Below is my docker file.  </p>
  
  <pre><code>FROM maven:3.6-jdk-11-openj9
  VOLUME ["/var/run/docker.sock"]
  RUN apt-get update
  RUN apt-get -y install docker.io
  COPY . /usr/src/app
  WORKDIR /usr/src/app
  RUN mvn -Dmaven.repo.local=/root/m2 --batch-mode -f pom.xml clean package
  EXPOSE 8080
  CMD ["/bin/bash"]
  </code></pre>
  
  <p>While running build  i am getting below below error </p>
  
  <p><code>org.testcontainers.dockerclient.EnvironmentAndSystemPropertyClientProviderStrategy - ping failed with configuration Environment variables, system properties and defaults. Resolved dockerHost=unix:///var/run/docker.sock due to org.rnorth.ducttape.TimeoutException: Timeout waiting for result with exception</code></p>
  
  <p>Whats the best way to handle this case ? I want to run my component level integration test during mvn build phase using docker file.</p>
  
  <p>below reference did not helped me. 
  <a href="https://www.testcontainers.org/supported_docker_environment/continuous_integration/dind_patterns/" rel="noreferrer">https://www.testcontainers.org/supported_docker_environment/continuous_integration/dind_patterns/</a></p>