diff --git a/docker/Dockerfile b/docker/Dockerfile index a8765d6..773849c 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -11,9 +11,12 @@ ENV ABRA2_VERSION ${ABRA2_VERSION} ENV JAVA_OPTS "-Xmx16G" ADD https://github.com/mozack/abra2/releases/download/v${ABRA2_VERSION}/abra2-${ABRA2_VERSION}.jar / +ADD run-abra2.sh / -RUN chmod 755 /abra2-${ABRA2_VERSION}.jar && \ +RUN chmod 755 /abra2-${ABRA2_VERSION}.jar /run-abra2.sh && \ ln -s /abra2-${ABRA2_VERSION}.jar /abra2.jar -ENTRYPOINT [ "java", "-jar", "/abra2.jar" ] + +# CMD java $JAVA_OPTS -jar /abra2.jar +CMD /run-abra2.sh # CMD [ --help ] diff --git a/docker/run-abra2.sh b/docker/run-abra2.sh new file mode 100644 index 0000000..30a7573 --- /dev/null +++ b/docker/run-abra2.sh @@ -0,0 +1,26 @@ +#! /bin/sh + +if [ -z $JAVA_OPTS ] ; then + JAVA_OPTS="-Xmx16g" +fi + +if [ -z $1 ] ; then + + java $JAVA_OPTS -jar /abra2.jar + + echo "" + echo "To use this Docker image, structure your command as follows:" + echo "" + echo " docker run abra:$ABRA2_VERSION java $JAVA_OPTS -jar /abra2.jar [options for ABRA2...]" + echo "" + echo "or pass in your JAVA_OPTS this way" + echo "" + echo " docker run --env JAVA_OPTS abra:$ABRA2_VERSION sh /run-abra2.sh [options for ABRA2...]" + echo "" + echo "Pay special care to set the --tmpdir option to a good location" + +else + + java $JAVA_OPTS -jar /abra2.jar $@ + +fi