Multiple gradle builds with docker
There is currently an issue open to share Gradle cache between containers:

https://github.com/gradle/gradle/issues/851

I think the best solution at the moment is to bake as many dependencies in to the Docker image as possible, and then use a volume to share between sequential builds, limiting it to one concurrent build per host. You can mount the cache on to the host with a docker-compose.yml like so:

version: '3'
services:
  gradle:
    image: gradle:4.0.1-jdk8-alpine  # I'd suggest using this as a base to build your own Gradle image with dependencies baked in
    working_dir: /usr/src/app
    volumes:
      - ./:/usr/src/app:Z
      - ./.gradle:/home/gradle/.gradle:Z


Alternatively, another solution would be to look at network-level caching e.g. Squid.