Skip to content

Commit

Permalink
Update the GATK base image to a newer LTS ubuntu release
Browse files Browse the repository at this point in the history
  • Loading branch information
droazen committed Dec 8, 2023
1 parent e2c5fab commit 34f373a
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 17 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG BASE_DOCKER=broadinstitute/gatk:gatkbase-3.1.0
ARG BASE_DOCKER=us.gcr.io/broad-dsde-methods/gatk-base-image-staging-area:3.2.0rc2

# stage 1 for constructing the GATK zip
FROM ${BASE_DOCKER} AS gradleBuild
Expand Down Expand Up @@ -93,8 +93,8 @@ RUN conda env create -n gatk -f /gatk/gatkcondaenv.yml && \
echo "source activate gatk" >> /gatk/gatkenv.rc && \
echo "source /gatk/gatk-completion.sh" >> /gatk/gatkenv.rc && \
conda clean -afy && \
find /opt/miniconda/ -follow -type f -name '*.a' -delete && \
find /opt/miniconda/ -follow -type f -name '*.pyc' -delete && \
find $CONDA_PATH -follow -type f -name '*.a' -delete && \
find $CONDA_PATH -follow -type f -name '*.pyc' -delete && \
rm -rf /root/.cache/pip

CMD ["bash", "--init-file", "/gatk/gatkenv.rc"]
Expand Down
35 changes: 21 additions & 14 deletions scripts/docker/gatkbase/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Using OpenJDK 17
# This Dockerfile does not require any files that are in the GATK4 repo.
FROM ubuntu:18.04
FROM ubuntu:22.04

#### Basic image utilities
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y --no-install-recommends \
python3 \
python3-pip \
wget \
curl \
bc \
Expand All @@ -15,10 +16,13 @@ RUN apt-get update && \
less \
bedtools \
samtools \
bcftools \
tabix \
git \
gpg-agent \
build-essential \
openjdk-17-jdk \
vim \
software-properties-common && \
apt-get -y clean && \
apt-get -y autoclean && \
Expand Down Expand Up @@ -54,17 +58,20 @@ CMD ["bash"]
ENV JAVA_LIBRARY_PATH /usr/lib/jni

# Install miniconda
ENV DOWNLOAD_DIR /downloads
ENV CONDA_URL https://repo.anaconda.com/miniconda/Miniconda3-py310_23.1.0-1-Linux-x86_64.sh
ENV CONDA_MD5 = "32d73e1bc33fda089d7cd9ef4c1be542616bd8e437d1f77afeeaf7afdb019787"
ENV CONDA_PATH /opt/miniconda
# Following the instructions from https://docs.conda.io/projects/conda/en/latest/user-guide/install/rpm-debian.html
# Note that this *does* install just miniconda, despite the package being named "conda"
RUN curl https://repo.anaconda.com/pkgs/misc/gpgkeys/anaconda.asc | gpg --dearmor > /tmp/conda.gpg && \
install -o root -g root -m 644 /tmp/conda.gpg /usr/share/keyrings/conda-archive-keyring.gpg && \
gpg --keyring /usr/share/keyrings/conda-archive-keyring.gpg --no-default-keyring --fingerprint 34161F5BF5EB1D4BFBBB8F0A8AEB4F8B29D82806 && \
rm /tmp/conda.gpg && \
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/conda-archive-keyring.gpg] https://repo.anaconda.com/pkgs/misc/debrepo/conda stable main" > /etc/apt/sources.list.d/conda.list && \
apt update && \
apt install conda && \
apt -y clean && \
apt -y autoclean && \
apt -y autoremove && \
. /opt/conda/etc/profile.d/conda.sh && \
conda -V

ENV CONDA_PATH /opt/conda
ENV PATH $CONDA_PATH/bin:$PATH
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 && \
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
20 changes: 20 additions & 0 deletions scripts/docker/gatkbase/stage_docker_base_in_cloud.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

if [ $# -ne 1 ]; then
echo "Usage: $0 docker_image_version"
exit 1
fi

IMAGE_VERSION=$1
IMAGE_NAME="us.gcr.io/broad-dsde-methods/gatk-base-image-staging-area"
DOCKER_IMAGE_TAG="${IMAGE_NAME}:${IMAGE_VERSION}"

gcloud builds submit --tag ${DOCKER_IMAGE_TAG} --timeout=24h --machine-type n1_highcpu_32

if [ $? -ne 0 ]; then
echo "gcloud builds submit failed"
exit 1
fi

echo "Successfully published image to staging area at ${DOCKER_IMAGE_TAG}"
exit 0

0 comments on commit 34f373a

Please sign in to comment.