Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/groovy/docker-groovy
Docker images with Groovy
https://github.com/groovy/docker-groovy
docker-image groovy
Last synced: about 1 month ago
JSON representation
Docker images with Groovy
- Host: GitHub
- URL: https://github.com/groovy/docker-groovy
- Owner: groovy
- License: apache-2.0
- Created: 2016-12-11T05:50:51.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2024-09-30T16:23:29.000Z (2 months ago)
- Last Synced: 2024-11-04T12:40:28.293Z (about 1 month ago)
- Topics: docker-image, groovy
- Language: Dockerfile
- Homepage: https://hub.docker.com/_/groovy/
- Size: 317 KB
- Stars: 42
- Watchers: 7
- Forks: 14
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ccamel - groovy/docker-groovy - Docker images with Groovy (Dockerfile)
README
# docker-groovy
## Supported tags and respective Dockerfile links
* [jdk8](https://github.com/groovy/docker-groovy/blob/master/jdk8/Dockerfile)
* [jdk11](https://github.com/groovy/docker-groovy/blob/master/jdk11/Dockerfile)
* [jdk11-alpine](https://github.com/groovy/docker-groovy/blob/master/jdk11-alpine/Dockerfile)
* [jdk17](https://github.com/groovy/docker-groovy/blob/master/jdk17/Dockerfile)
* [jdk17-alpine](https://github.com/groovy/docker-groovy/blob/master/jdk17-alpine/Dockerfile)
* [jdk21](https://github.com/groovy/docker-groovy/blob/master/jdk21/Dockerfile)
* [jdk21-alpine](https://github.com/groovy/docker-groovy/blob/master/jdk21-alpine/Dockerfile)## What is Groovy?
[Apache Groovy](http://groovy-lang.org/) 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
#### Bash/Zsh
`docker run --rm -v "$PWD":/home/groovy/scripts -w /home/groovy/scripts groovy:latest groovy <script-args>`
#### PowerShell
`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
```xml
<!-- same thing as https://github.com/apache/groovy/blob/master/src/resources/groovy/grape/defaultGrapeConfig.xml, but with ${user.home} replaced with /home/groovy -->
<ivysettings>
<settings defaultResolver="downloadGrapes"/>
<resolvers>
<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]"/>
</filesystem>
<ibiblio name="localm2" root="/home/groovy/.m2/repository/" checkmodified="true" changingPattern=".*" changingMatcher="regexp" m2compatible="true"/>
<ibiblio name="jcenter" root="https://jcenter.bintray.com/" m2compatible="true"/>
<ibiblio name="ibiblio" m2compatible="true"/>
</chain>
</resolvers>
</ivysettings>
```## Instructions for a new Groovy release
1. Run `update.sh <new Groovy version>` or `update.ps1 <new Groovy version>`.
1. If a Groovy contributor did a release for the first time (his/her key added to https://downloads.apache.org/groovy/KEYS),
add the new key to the list of keys used for verification (this is quite infrequent).
1. Commit and push the changes.
1. Update [official-images](https://github.com/docker-library/official-images) (and [docs](https://github.com/docker-library/docs) if appropriate).---
[![Build status badge](https://github.com/groovy/docker-groovy/workflows/GitHub%20CI/badge.svg)](https://github.com/groovy/docker-groovy/actions?query=workflow%3A%22GitHub+CI%22)