Permalink
Browse files

Provided a helper script for passing JVM args to docker.

Also added a docker ignore
  • Loading branch information...
1 parent 9dfe08e commit 87484f5b95361f3bea809e9182d44790fcbed1c0 @bradtaylor bradtaylor committed Jul 17, 2015
Showing with 54 additions and 2 deletions.
  1. +18 −0 .dockerignore
  2. +9 −2 Dockerfile
  3. +27 −0 src/scripts/picard/docker_helper.sh
View
@@ -0,0 +1,18 @@
+.git
+.gitignore
+.jar_opt
+.classpath
+.project
+.travis.yml
+build.sbt
+Picard-public.fbp
+Picard-public.iml
+Picard-public.ipr
+README.md
+classes
+dist
+etc
+htsjdk
+project
+testclasses
+testdata
View
@@ -19,6 +19,13 @@ WORKDIR /usr/picard
RUN git config --global http.sslVerify false && git clone https://github.com/samtools/htsjdk.git RUN git config --global http.sslVerify false && git clone https://github.com/samtools/htsjdk.git
# Build the distribution jar, clean up everything else # Build the distribution jar, clean up everything else
-RUN ant clean all && mv dist/picard.jar picard.jar && ant clean && rm -rf htsjdk && rm -rf src && rm -rf lib && rm build.xml +RUN ant clean all && \
+ mv dist/picard.jar picard.jar && \
+ mv src/scripts/picard/docker_helper.sh docker_helper.sh && \
+ ant clean && \
+ rm -rf htsjdk && \
+ rm -rf src && \
+ rm -rf lib && \
+ rm build.xml
-ENTRYPOINT ["java", "-jar", "picard.jar"] +ENTRYPOINT ["./docker_helper.sh"]
@@ -0,0 +1,27 @@
+#!/usr/bin/env bash
+
+# Example Usage: ./docker_helper.sh -j "-XX:GCTimeLimit=50 -XX:GCHeapFreeLimit=10 -Xmx4000m" MarkDuplicates INPUT=fake.bam ...
+usage() {
+ cat << EOF
+Usage: $0 [-j <JVM arguments>] tool_name tool_arguments
+
+Run Picard with JVM args and program args if present. Assumes picard.jar lives in the same directory.
+JVM arguments should be a quoted, space separated list.
+
+Example Usage:
+./docker_helper.sh -j "-XX:GCTimeLimit=50 -XX:GCHeapFreeLimit=10 -Xmx4000m" MarkDuplicates INPUT=fake.bam ...
+
+EOF
+ exit 1
+}
+while getopts "j:h" OPTION; do
+ case $OPTION in
+ j) JVM_ARGS=$OPTARG;;
+ h) usage; exit 0;;
+ [?]) usage; exit 1;;
+ esac
+done
+shift $(expr $OPTIND - 1)
+TOOL_WITH_ARGS=$@
+
+java ${JVM_ARGS} -jar picard.jar ${TOOL_WITH_ARGS}

0 comments on commit 87484f5

Please sign in to comment.