Docker Groovy Save

Docker images with Groovy

Project README


What is Groovy?

Apache Groovy is a powerful, optionally typed and dynamic language, with static-typing and static compilation capabilities, for the Java platform aimed at improving developer productivity thanks to a concise, familiar and easy to learn syntax. It integrates smoothly with any Java program, and immediately delivers to your application powerful features, including scripting capabilities, Domain-Specific Language authoring, runtime and compile-time meta-programming and functional programming.

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

Starting Groovysh

docker run -it --rm groovy:latest

Running a Groovy script


docker run --rm -v "$PWD":/home/groovy/scripts -w /home/groovy/scripts groovy:latest groovy <script> <script-args>


docker run --rm -v "${pwd}:/home/groovy/scripts" -w /home/groovy/scripts groovy:latest groovy <script> <script-args>

Windows CMD

docker run --rm -v "%cd%:/home/groovy/scripts" -w /home/groovy/scripts groovy:latest groovy <script> <script-args>

Reusing the Grapes cache

The local Grapes cache can be reused across containers by creating a volume and mounting it in /home/groovy/.groovy/grapes.

docker volume create --name grapes-cache
docker run --rm -it -v grapes-cache:/home/groovy/.groovy/grapes groovy:latest

Note when running as another user (other than groovy or root), you will need to tell Groovy what home to use for Grapes with -D user.home=/home/groovy.

Alternatively, you can specify this through the Grapes config, using -D grape.config=/home/groovy/scripts/grapesConfig.xml and

<!-- same thing as, but with ${user.home} replaced with /home/groovy -->
  <settings defaultResolver="downloadGrapes"/>
    <chain name="downloadGrapes" returnFirst="true">
      <filesystem name="cachedGrapes">
        <ivy pattern="/home/groovy/.groovy/grapes/[organisation]/[module]/ivy-[revision].xml"/>
        <artifact pattern="/home/groovy/.groovy/grapes/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]"/>
      <ibiblio name="localm2" root="/home/groovy/.m2/repository/" checkmodified="true" changingPattern=".*" changingMatcher="regexp" m2compatible="true"/>
      <ibiblio name="jcenter" root="" m2compatible="true"/>
      <ibiblio name="ibiblio" m2compatible="true"/>

Instructions for a new Groovy release

  1. Run <new Groovy version> or update.ps1 <new Groovy version>.
  2. If a Groovy contributor did a release for the first time (his/her key added to, add the new key to the list of keys used for verification (this is quite infrequent).
  3. Commit and push the changes.
  4. Update official-images (and docs if appropriate).

Build status badge

Open Source Agenda is not affiliated with "Docker Groovy" Project. README Source: groovy/docker-groovy
Open Issues
Last Commit
2 weeks ago

Open Source Agenda Badge

Open Source Agenda Rating