Last active
June 2, 2020 01:37
-
-
Save melix/e4b63fd684e63713c162 to your computer and use it in GitHub Desktop.
Dockerfile for Groovy
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
################################################ | |
# Dockerfile to run Groovy containers | |
# Based on Java 8 image | |
################################################ | |
FROM java:8u40-jdk | |
MAINTAINER Cédric Champeau | |
# Install GVM | |
RUN curl -s get.gvmtool.net | bash | |
RUN ["/bin/bash", "-c", "source /root/.gvm/bin/gvm-init.sh"] | |
RUN echo "gvm_suggestive_selfupdate=false" >> /root/.gvm/etc/config | |
RUN ["/bin/bash", "-c", "-l", "gvm install groovy"] | |
# Fix path | |
ENV GROOVY_HOME /root/.gvm/groovy/current | |
ENV PATH $GROOVY_HOME/bin:$PATH |
I don't think RUN ["/bin/bash", "-c", "source /root/.gvm/bin/gvm-init.sh"]
is needed either
Wouldn't an entrypoint limit the container to a single command? (here groovy
) where I could want to use groovy
, groovysh
, groovyc
and friends?
yes it would.
A smaller image variant, which uses an explicit version and does not require GVM:
################################################
# Dockerfile to run Groovy containers
# Based on Java 8 image
################################################
FROM debian:latest
MAINTAINER Cédric Champeau
RUN apt-get update && \
apt-get upgrade && \
apt-get -y install wget unzip && \
apt-get clean
RUN cd /tmp && \
wget --no-check-certificate http://www.java.net/download/jdk8u40/archive/b15/binaries/jdk-8u40-ea-bin-b15-linux-x64-18_nov_2014.tar.gz && \
tar xzf jdk-8u40-ea-bin-b15-linux-x64-18_nov_2014.tar.gz && \
mv jdk1.8.0_40 /jdk && \
rm -f jdk-8u40-ea-bin-b15-linux-x64-18_nov_2014.tar.gz
RUN cd /tmp && \
wget http://dl.bintray.com/groovy/maven/groovy-binary-2.4.0-beta-4.zip && \
unzip groovy-binary-2.4.0-beta-4.zip && \
mv groovy-2.4.0-beta-4 /groovy && \
rm groovy-binary-2.4.0-beta-4.zip
ENV JAVA_HOME /jdk
ENV GROOVY_HOME /groovy
ENV PATH $GROOVY_HOME/bin/:$PATH
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This whole section is not needed:
You might also want set an entrypoint that points to groovy