-
-
Save blackandred/596806af853557c53614b0d034327798 to your computer and use it in GitHub Desktop.
Use dockerized java easily, instead of running java on host. Keeps gradle cached packages in a mapped volume.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SUDO=${SUDO:-sudo} | |
IMAGE=${IMAGE:-openjdk:8-jre-stretch} | |
PARAMS="$@" | |
if [[ ! ${PARAMS} ]]; then | |
PARAMS="exit 1" | |
fi | |
exec ${SUDO} docker run --rm --name djvm \ | |
-i \ | |
-t \ | |
-v $(pwd):/build \ | |
-v $(dirname ~/.gradle/dirname_suffix):/root/.gradle \ | |
${IMAGE} \ | |
/bin/bash -c "cd /build && $PARAMS" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When there will be a false lock: