title: Gradle fails when run in docker container
body: <p>I am using Gradle and it works fine, except when I run it in a docker container. I use the jOOQ code generator. The generated source files are in <code>build/generated-src/jooq</code>, but the when building in the docker container, the <em>compileJava</em> task fails. I get compilation errors as the generated sources were not compiled, as an example:</p>
  
  <pre><code>/home/gradle/src/src/main/java/test/service/UserService.java:4: error: 
  package test.database.mydb.tables.records does not exist
  import test.database.mydb.tables.records.UserRecord;
  </code></pre>
  
  <p>In both occasions Gradle version <em>6.0.1</em> was used.</p>
  
  <p>The Dockerfile:</p>
  
  <pre><code>FROM gradle:jdk11 as build-stage
  COPY --chown=gradle:gradle . /home/gradle/src
  WORKDIR /home/gradle/src
  RUN gradle clean build
  </code></pre>
  
  <p>My build.gradle:</p>
  
  <pre><code>plugins {
      id 'java'
      id 'application'
      id 'nu.studer.jooq' version '3.0.3'
  }
  
  [...]
  
  sourceSets.main.java.srcDir new File(buildDir, '/generated-src/jooq') // adding the generated sources of jooq folder to the main source set
  
  jooq {
      version = '3.12.3'
      edition = 'OSS'
      database(sourceSets.main) {
          generator {
              database {
                  [...]
              }
              target {
                  packageName = 'me.mtte.code.ideahub.database'
                  directory = new File(buildDir, '/generated-src/jooq') // the output directory
                  clean = true
              }
          }
      }
  }
  </code></pre>
  
  <p>Does anyone know why there is a difference between with and without docker container?</p>