/docker-gradle

Docker images with Gradle

Primary LanguageDockerfileApache License 2.0Apache-2.0

docker-gradle

Supported tags and respective Dockerfile links

What is Gradle?

Gradle is a build tool with a focus on build automation and support for multi-language development. If you are building, testing, publishing, and deploying software on any platform, Gradle offers a flexible model that can support the entire development lifecycle from compiling and packaging code to publishing web sites. Gradle has been designed to support build automation across multiple languages and platforms including Java, Scala, Android, C/C++, and Groovy, and is closely integrated with development tools and continuous integration servers including Eclipse, IntelliJ, and Jenkins.

How to use this image

Note that if you are mounting a volume and the uid running Docker is not 1000, you should run as user root (-u root).

Building a Gradle project

Run this from the directory of the Gradle project you want to build.

docker run --rm -v "$PWD":/home/gradle/project -w /home/gradle/project gradle:latest gradle <gradle-task>

Reusing the Gradle cache

The local Gradle cache can be reused across containers by creating a volume and mounting it to /home/gradle/.gradle. Note that sharing between concurrently running containers doesn't work currently (see #851).

docker volume create --name gradle-cache
docker run --rm -v gradle-cache:/home/gradle/.gradle -v "$PWD":/home/gradle/project -w /home/gradle/project gradle:latest gradle <gradle-task>

Instructions for a new Gradle release

  1. Run update.sh <new Gradle version>.
  2. Commit and push the changes.
  3. Update official-images (and docs if appropriate).

Travis Build Status