Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Update base image #8228

Merged
merged 2 commits into from
Mar 15, 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
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/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, good idea....

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 && \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OpenJDK 8 reference on line 1 but GitHub won't let me comment there

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mcovarr Thank you, good catch!

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 && \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm so glad someone knows how todo this...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect I'm repeating myself because I don't really know how to do it. Throw all the cleaning at the wall and hope something sticks.

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/*