How to prevent downloading of Gradle dependencies when doing docker run for gradle projects

in docker •  7 years ago 

Write these entries into your Dockerfile as follows:

RUN mkdir -p /root/.gradle
ENV HOME /root
VOLUME /root/.gradle

In your docker run command, you just need to amount your root .gradle folder from your machine like so:

docker run -v ~/.gradle:/root/.gradle imagename:tagname

The gradle dependencies will be downloaded the first time, and for subsequent gradle runs, it won’t download anymore.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Congratulations @kevinhatan! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Do not miss the last post from @steemitboard:

SteemitBoard Ranking update - A better rich list comparator
Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Congratulations @kevinhatan! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

You got a First Vote

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

Upvote this notification to help all Steemit users. Learn why here!

Congratulations @kevinhatan! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 1 year!

Click here to view your Board

Support SteemitBoard's project! Vote for its witness and get one more award!