Skip to content
New issue

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

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

Already on GitHub? # to your account

Update Dockerfile and build_push_docker.sh #1921

Merged
merged 1 commit into from
Nov 29, 2023
Merged
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
46 changes: 26 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,31 +1,37 @@
FROM eclipse-temurin:17-jdk
MAINTAINER Broad Institute DSDE <dsde-engineering@broadinstitute.org>
ARG BASE_DOCKER=eclipse-temurin:17-jdk
ARG release=false

ARG build_command=shadowJar
ARG jar_name=picard.jar
FROM ${BASE_DOCKER} as build
LABEL stage=buildStage

# Install ant, git for building
# Install git for building
RUN apt-get update && \
apt-get --no-install-recommends install -y \
git \
r-base \
ant && \
apt-get clean autoclean && \
apt-get autoremove -y
git

# Assumes Dockerfile lives in root of the git repo. Pull source files into container
COPY / /usr/picard/
WORKDIR /usr/picard

# Build the distribution jar, clean up everything else
RUN ./gradlew ${build_command} && \
mv build/libs/${jar_name} picard.jar && \
./gradlew clean && \
rm -rf src && \
rm -rf gradle && \
rm -rf .git && \
rm gradlew && \
rm build.gradle
# download gradle then build
RUN ./gradlew -Drelease=${release} \
clean \
printVersion \
shadowJar

FROM ${BASE_DOCKER} as final
MAINTAINER Broad Institute DSDE <dsde-engineering@broadinstitute.org>

# Install R
RUN apt-get update && \
apt-get --no-install-recommends install -y \
r-base &&\
apt-get clean autoclean && \
apt-get autoremove -y

RUN mkdir /usr/picard/

COPY --from=build /usr/picard/build/libs/picard.jar /usr/picard/

RUN mkdir /usr/working
WORKDIR /usr/working
WORKDIR /usr/working
2 changes: 1 addition & 1 deletion build_push_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ read -p "Is this really what you want to do? " -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
docker build -t ${PICARD_CLOUD_TAG} --build-arg build_command=cloudJar --build-arg jar_name=picardcloud.jar .
docker build -t ${PICARD_CLOUD_TAG} --build-arg release=true .
docker push ${PICARD_CLOUD_TAG}
fi
Loading