Skip to content

Commit

Permalink
Update base image to 3.0.0(#8228)
Browse files Browse the repository at this point in the history
* Updating the base image to include Java 17
* Updating ubuntu to the newest 18.04 release
  • Loading branch information
lbergelson committed Mar 15, 2023
1 parent 4ba4ab5 commit bab0adc
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 42 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# These are files that for whatever reason we don't want to include in our distribution docker images
src/test/resources
src/test/resources/*
build/
31 changes: 2 additions & 29 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# stage 1 for constructing the GATK zip
FROM broadinstitute/gatk:gatkbase-2.3.0 AS gradleBuild
FROM broadinstitute/gatk:gatkbase-3.0.0 AS gradleBuild
LABEL stage=gatkIntermediateBuildImage
ARG RELEASE=false

Expand All @@ -16,46 +16,19 @@ RUN add-apt-repository universe && apt update
RUN apt-get --assume-yes install git-lfs
RUN git lfs install --force

##Get Java 17 temurin JDK
#RUN apt update && apt upgrade
RUN apt install wget
RUN wget https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.6%2B10/OpenJDK17U-jdk_x64_linux_hotspot_17.0.6_10.tar.gz
RUN tar -xvf OpenJDK17U-jdk_x64_linux_hotspot_17.*.tar.gz
RUN mv jdk-17.0.6+10 /opt/
#
ENV JAVA_HOME /opt/jdk-17.0.6+10
ENV PATH $JAVA_HOME/bin:$PATH
RUN echo $JAVA_HOME
RUN update-alternatives --install /usr/bin/java java /opt/jdk-17.0.6+10/bin/java 1
RUN java -version

#Download only resources required for the build, not for testing
RUN git lfs pull --include src/main/resources/large

RUN export GRADLE_OPTS="-Xmx4048m -Dorg.gradle.daemon=false" && /gatk/gradlew clean collectBundleIntoDir shadowTestClassJar shadowTestJar -Drelease=$RELEASE
RUN cp -r $( find /gatk/build -name "*bundle-files-collected" )/ /gatk/unzippedJar/
RUN unzip -o -j $( find /gatk/unzippedJar -name "gatkPython*.zip" ) -d /gatk/unzippedJar/scripts

# Using OpenJDK 8
FROM broadinstitute/gatk:gatkbase-2.3.0
FROM broadinstitute/gatk:gatkbase-3.0.0

RUN rm /etc/apt/sources.list.d/google-cloud-sdk.list
RUN apt update
RUN apt-key list

#Get Java 17 temurin JDK
#RUN apt update && apt upgrade
RUN apt install wget
RUN wget https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.6%2B10/OpenJDK17U-jdk_x64_linux_hotspot_17.0.6_10.tar.gz
RUN tar -xvf OpenJDK17U-jdk_x64_linux_hotspot_17.*.tar.gz
RUN mv jdk-17.0.6+10 /opt/

ENV JAVA_HOME /opt/jdk-17.0.6+10
ENV PATH $JAVA_HOME/bin:$PATH
RUN echo $JAVA_HOME
RUN update-alternatives --install /usr/bin/java java /opt/jdk-17.0.6+10/bin/java 1
RUN java -version

WORKDIR /gatk

# Location of the unzipped gatk bundle files
Expand Down
32 changes: 19 additions & 13 deletions scripts/docker/gatkbase/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Using OpenJDK 8
# Using OpenJDK 17
# This Dockerfile does not require any files that are in the GATK4 repo.
FROM ubuntu:18.04

#### Basic image utilities
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y --no-install-recommends \
python \
python3 \
wget \
curl \
bc \
Expand All @@ -15,23 +15,27 @@ RUN apt-get update && \
less \
bedtools \
samtools \
openjdk-8-jdk \
tabix \
gpg-agent \
build-essential \
openjdk-17-jdk \
software-properties-common && \
apt-get -y clean && \
apt-get -y autoclean && \
apt-get -y autoremove

RUN java -version

#### Specific for google cloud support
RUN export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)" && \
echo "deb http://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - && \
apt-get update -y && apt-get install google-cloud-sdk -y && \
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" \
| tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && curl https://packages.cloud.google.com/apt/doc/apt-key.gpg \
| apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - && \
apt-get update -y && \
apt-get install -y --no-install-recommends google-cloud-cli && \
apt-get -y clean && \
apt-get -y autoclean && \
apt-get -y autoremove && \
apt-get -y clean
###########
find / -wholename "*__pycache__/*.pyc" -exec rm {} +

# Set environment variables.
ENV HOME /root
Expand All @@ -43,9 +47,6 @@ WORKDIR /root
CMD ["bash"]

ENV JAVA_LIBRARY_PATH /usr/lib/jni
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/

RUN java -version

# Install miniconda
ENV DOWNLOAD_DIR /downloads
Expand All @@ -56,7 +57,12 @@ RUN mkdir $DOWNLOAD_DIR && \
wget -nv -O $DOWNLOAD_DIR/miniconda.sh $CONDA_URL && \
test "`md5sum $DOWNLOAD_DIR/miniconda.sh | awk -v FS=' ' '{print $1}'` = $CONDA_MD5" && \
bash $DOWNLOAD_DIR/miniconda.sh -p $CONDA_PATH -b && \
rm $DOWNLOAD_DIR/miniconda.sh
rm $DOWNLOAD_DIR/miniconda.sh && \
${CONDA_PATH}/bin/conda clean -afy && \
find /opt/miniconda/ -follow -type f -name '*.a' -delete && \
find /opt/miniconda/ -follow -type f -name '*.pyc' -delete && \
rm -rf /root/.cache/pip


# Deleting unneeded caches
RUN rm -rf /var/lib/apt/lists/*

0 comments on commit bab0adc

Please sign in to comment.