-
Notifications
You must be signed in to change notification settings - Fork 369
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Dockerfile and build_push_docker.sh (#1921)
* This adjust for the lack of picard cloud jar and properly sets the picard version so it's not listed as "snapshot" * Update the docker build to use staged builds. This reduces the build size from about 1.7gb to about 650mb
- Loading branch information
1 parent
257c1c1
commit 98c86c4
Showing
2 changed files
with
27 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,37 @@ | ||
FROM eclipse-temurin:17-jdk | ||
MAINTAINER Broad Institute DSDE <[email protected]> | ||
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 <[email protected]> | ||
|
||
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters