title: Maven build and tests very slow on Docker
body: <p>I'm trying setup my Gitlab CI/CD to compile and run tests for my Java/Maven/Spring Boot application.
  I've setup a Gitlab Runner and created my .gitlab-ci.yml and it all worked, but VERY SLOW.
  I've tried many configurations for my runner, without success.</p>
  <p>So i made a step back and tried to run the tests on Docker on my local machine.</p>
  <p>The build + tests running directly on my machine takes 17min.
  The build + tests running on docker takes more than 1h.</p>
  <p>The best performance i've got was using using this docker command:</p>
  <p><code>docker run -it --rm --name comp2 --mount type=bind,source=&quot;C:/ProjetosJava/eaud&quot;,destination=/usr/src/mymaven -e MAVEN_OPTS='-Xdebug -Xnoagent -Djava.compiler=NONE -Xmx4096m -Xms1024m -XX:MaxPermSize=1024m -Dmaven.repo.local=.m2/repository -XX:+TieredCompilation -XX:TieredStopAtLevel=1' -w /usr/src/mymaven maven:3.3-jdk-8 /bin/bash</code></p>
  <p>and inside bash i did:</p>
  <p><code>mvn -s .m2/settings.xml clean compile test</code></p>
  <p>I need the build inside docker to have at minimun a close time (17min).</p>