Code Monkey home page Code Monkey logo

docker-gradle's Introduction

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

If you are mounting a volume and the uid/gid running Docker is not 1000, you should run as user root (-u root). root is also the default, so you can also simply not specify a user.

Building a Gradle project

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

Bash/Zsh

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

PowerShell

docker run --rm -u gradle -v "${pwd}:/home/gradle/project" -w /home/gradle/project gradle:latest gradle <gradle-task>

Windows CMD

docker run --rm -u gradle -v "%cd%:/home/gradle/project" -w /home/gradle/project gradle:latest gradle <gradle-task>

Note the above command runs using uid/gid 1000 (user gradle) to avoid running as root.

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).

Also, currently it's not possible to override the volume declaration of the parent. So if you are using this image as a base image and want the Gradle cache to be written into the next layer, you will need to use a new user (or use the --gradle-user-home/-g argument) so that a new cache is created that isn't mounted to a volume.

docker volume create --name gradle-cache
docker run --rm -u gradle -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 or update.ps1.
  2. Commit and push the changes.
  3. Update official-images (and docs if appropriate).

Build status badge

docker-gradle's People

Contributors

keeganwitt avatar sineaggi avatar j0wi avatar chadlwilson avatar jurriaan avatar benkard avatar josmo avatar nycodeghg avatar m-burst avatar richyhbm avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.