Skip to content

Commit e65a310

Browse files
authored
Make picardcloud accessible in docker image (broadinstitute#1153)
* Added build script to build and push docker images
1 parent 7654d52 commit e65a310

File tree

3 files changed

+35
-3
lines changed

3 files changed

+35
-3
lines changed

Dockerfile

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
FROM broadinstitute/java-baseimage
22
MAINTAINER Broad Institute DSDE <[email protected]>
33

4+
ARG build_command=shadowJar
5+
ARG jar_name=picard.jar
6+
47
# Install ant, git for building
58
RUN apt-get update && \
69
apt-get --no-install-recommends install -y --force-yes \
@@ -14,8 +17,8 @@ COPY / /usr/picard/
1417
WORKDIR /usr/picard
1518

1619
# Build the distribution jar, clean up everything else
17-
RUN ./gradlew shadowJar && \
18-
mv build/libs/picard.jar picard.jar && \
20+
RUN ./gradlew ${build_command} && \
21+
mv build/libs/${jar_name} picard.jar && \
1922
mv src/main/resources/picard/docker_helper.sh docker_helper.sh && \
2023
./gradlew clean && \
2124
rm -rf src && \

build_push_docker.sh

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env bash
2+
3+
# This script is used to build and deploy docker images for Picard
4+
5+
if [[ "$1" == "" ]]
6+
then
7+
echo "Usage: build_push_docker.sh <git-tag>"
8+
exit 1
9+
fi
10+
11+
declare -r TAG=${1}
12+
13+
declare -r PICARD_TAG=broadinstitute/picard:${TAG}
14+
declare -r PICARD_CLOUD_TAG=us.gcr.io/broad-gotc-prod/picard-cloud:${TAG}
15+
16+
echo "Will build and push the following docker images:"
17+
echo ${PICARD_TAG}
18+
echo ${PICARD_CLOUD_TAG}
19+
20+
read -p "Is this really what you want to do? " -n 1 -r
21+
echo # (optional) move to a new line
22+
if [[ $REPLY =~ ^[Yy]$ ]]
23+
then
24+
docker build -t ${PICARD_TAG} --build-arg build_command=shadowJar --build-arg jar_name=picard.jar .
25+
docker build -t ${PICARD_CLOUD_TAG} --build-arg build_command=cloudJar --build-arg jar_name=picardcloud.jar .
26+
27+
docker push ${PICARD_TAG}
28+
gcloud docker -- push ${PICARD_CLOUD_TAG}
29+
fi

src/main/resources/picard/docker_helper.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ done
2424
shift $(expr $OPTIND - 1)
2525
TOOL_WITH_ARGS=$@
2626

27-
java ${JVM_ARGS} -jar /usr/picard/picard.jar ${TOOL_WITH_ARGS}
27+
java ${JVM_ARGS} -jar /usr/picard/picard*.jar ${TOOL_WITH_ARGS}

0 commit comments

Comments
 (0)