Adsmurai's Dockerized Gradle
This version of dockerized gradle is inspired by the official gradle's docker repository, but it has some extra nice features, like UIDs and GIDs mapping.
For example, if you want to execute the build task
docker run \ --rm \ -it \ -v /home/user/sourcedir/:/home/apprunner/playground \ -e HOST_USER_ID=$(id -u) \ -e HOST_GROUP_ID=$(id -g) \ adsmurai/gradle:4.4-jdk8 \ gradle build
In order to use the Gradle's cache, you can also mount a specific volume with the option
We recommend to NOT mapping the equivalent directory inside the host (
-v /home/host_username/.gradle:/home/apprunner/.gradle) because the custom entry point of this image explicitly disables the Gradle's daemon modifying the settings files inside this directory.