Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile #28

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]
26 changes: 26 additions & 0 deletions docker/run-abra2.sh
Original file line number Diff line number Diff line change
@@ -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