diff --git a/.dockerignore b/.dockerignore index 4e1f4c2b729..c61b0d7d079 100644 --- a/.dockerignore +++ b/.dockerignore @@ -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/ diff --git a/Dockerfile b/Dockerfile index 2e85b4d8c84..98f8a3ffdfc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 @@ -16,19 +16,6 @@ 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 @@ -36,26 +23,12 @@ RUN export GRADLE_OPTS="-Xmx4048m -Dorg.gradle.daemon=false" && /gatk/gradlew cl 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 diff --git a/scripts/docker/gatkbase/Dockerfile b/scripts/docker/gatkbase/Dockerfile index 8305a4764c9..95bafaa9350 100644 --- a/scripts/docker/gatkbase/Dockerfile +++ b/scripts/docker/gatkbase/Dockerfile @@ -1,4 +1,4 @@ -# Using OpenJDK 8 +# Using OpenJDK 17 # This Dockerfile does not require any files that are in the GATK4 repo. FROM ubuntu:18.04 @@ -6,7 +6,7 @@ FROM ubuntu:18.04 RUN apt-get update && \ apt-get upgrade -y && \ apt-get install -y --no-install-recommends \ - python \ + python3 \ wget \ curl \ bc \ @@ -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 @@ -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 @@ -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/*