From 318e0d16474b5650cc8274eb8ceb07d37f9c4c3d Mon Sep 17 00:00:00 2001 From: EddieLF Date: Mon, 2 Mar 2026 15:40:01 +1100 Subject: [PATCH 1/5] Build GATK from source with htsjdk 4.3.0 for CRAM v3.1 support --- images/gatk/Dockerfile | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/images/gatk/Dockerfile b/images/gatk/Dockerfile index 0d1e7f29..28fa2e54 100644 --- a/images/gatk/Dockerfile +++ b/images/gatk/Dockerfile @@ -14,6 +14,7 @@ RUN apt-get update && \ libgomp1 \ openjdk-17-jdk-headless \ procps \ + r-base=4.3.1 \ rsync \ software-properties-common \ unzip \ @@ -21,7 +22,8 @@ RUN apt-get update && \ zip && \ rm -r /var/lib/apt/lists/* && \ rm -r /var/cache/apt/* && \ - pip install --no-cache-dir --upgrade pip + pip install --no-cache-dir --upgrade pip && \ + git lfs install # build bcftools from source FROM base AS compiler @@ -48,6 +50,7 @@ RUN apt-get update && apt-get install -y \ make -C htslib-$BCFTOOLS_VERSION DESTDIR=/bcftools_install install +# build GATK image from source, using the compiled bcftools binaries and plugins FROM base COPY --from=compiler /bcftools_install/usr/local/bin/* /usr/local/bin/ @@ -62,11 +65,23 @@ RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages. rm -r /var/lib/apt/lists/* && \ rm -r /var/cache/apt/* -# download and install GATK pre-built release -RUN wget -q https://github.com/broadinstitute/gatk/releases/download/4.6.2.0/gatk-4.6.2.0.zip && \ - unzip gatk-4.6.2.0.zip && \ - rm gatk-4.6.2.0.zip && \ - chmod +x /gatk-4.6.2.0/gatk +# Clone GATK source code (including large files with git-lfs) and build the GATK jar file +RUN git clone --branch ${VERSION} https://github.com/broadinstitute/gatk.git /usr/gatk && \ + git lfs pull +WORKDIR /usr/gatk + +# Build GATK with htsjdk 4.3.0 for CRAM v3.1 support +RUN ./gradlew clean printVersion shadowJar -Dhtsjdk.version=4.3.0 ENV PATH=$PATH:/gatk-4.6.2.0 WORKDIR /gatk-4.6.2.0 + +# Install Miniconda3-py310_23.10.0-1 +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-py310_23.10.0-1-Linux-x86_64.sh -O /tmp/miniconda.sh && \ + bash /tmp/miniconda.sh -p /opt/miniconda -b && \ + rm /tmp/miniconda.sh && \ + /opt/miniconda/bin/conda clean -afy && \ + conda config --set auto_update_conda false && \ + conda config --set solver libmamba && \ + ./gradlew localDevCondaEnv && \ + source activate gatk From f7ea0a8983136447c3dd888fe049a8ed2b25548f Mon Sep 17 00:00:00 2001 From: EddieLF Date: Mon, 2 Mar 2026 15:51:17 +1100 Subject: [PATCH 2/5] remove R-base install from apt-get install list --- images/gatk/Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/images/gatk/Dockerfile b/images/gatk/Dockerfile index 28fa2e54..326b399b 100644 --- a/images/gatk/Dockerfile +++ b/images/gatk/Dockerfile @@ -14,7 +14,6 @@ RUN apt-get update && \ libgomp1 \ openjdk-17-jdk-headless \ procps \ - r-base=4.3.1 \ rsync \ software-properties-common \ unzip \ From 0594ca9e0651bacc7e85466d69e0e3b432827d7f Mon Sep 17 00:00:00 2001 From: EddieLF Date: Mon, 2 Mar 2026 15:56:58 +1100 Subject: [PATCH 3/5] Install git-lfs with apt-get install --- images/gatk/Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/images/gatk/Dockerfile b/images/gatk/Dockerfile index 326b399b..37814bf3 100644 --- a/images/gatk/Dockerfile +++ b/images/gatk/Dockerfile @@ -9,6 +9,7 @@ RUN apt-get update && \ ca-certificates \ curl \ git \ + git-lfs \ gnupg \ jq \ libgomp1 \ @@ -21,8 +22,7 @@ RUN apt-get update && \ zip && \ rm -r /var/lib/apt/lists/* && \ rm -r /var/cache/apt/* && \ - pip install --no-cache-dir --upgrade pip && \ - git lfs install + pip install --no-cache-dir --upgrade pip # build bcftools from source FROM base AS compiler @@ -75,7 +75,7 @@ RUN ./gradlew clean printVersion shadowJar -Dhtsjdk.version=4.3.0 ENV PATH=$PATH:/gatk-4.6.2.0 WORKDIR /gatk-4.6.2.0 -# Install Miniconda3-py310_23.10.0-1 +# Install Miniconda3-py310_23.10.0-1 RUN wget https://repo.anaconda.com/miniconda/Miniconda3-py310_23.10.0-1-Linux-x86_64.sh -O /tmp/miniconda.sh && \ bash /tmp/miniconda.sh -p /opt/miniconda -b && \ rm /tmp/miniconda.sh && \ @@ -83,4 +83,4 @@ RUN wget https://repo.anaconda.com/miniconda/Miniconda3-py310_23.10.0-1-Linux-x8 conda config --set auto_update_conda false && \ conda config --set solver libmamba && \ ./gradlew localDevCondaEnv && \ - source activate gatk + source activate gatk From 82009eb7eaf6ee01956664d6d60e1c5b89367a8e Mon Sep 17 00:00:00 2001 From: EddieLF Date: Mon, 2 Mar 2026 16:36:10 +1100 Subject: [PATCH 4/5] Split out git lfs commands --- images/gatk/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/images/gatk/Dockerfile b/images/gatk/Dockerfile index 37814bf3..59be15c0 100644 --- a/images/gatk/Dockerfile +++ b/images/gatk/Dockerfile @@ -65,10 +65,10 @@ RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages. rm -r /var/cache/apt/* # Clone GATK source code (including large files with git-lfs) and build the GATK jar file -RUN git clone --branch ${VERSION} https://github.com/broadinstitute/gatk.git /usr/gatk && \ - git lfs pull -WORKDIR /usr/gatk +RUN git clone --branch ${VERSION} --depth 1 https://github.com/broadinstitute/gatk.git +RUN git lfs install && \ + git lfs pull # Build GATK with htsjdk 4.3.0 for CRAM v3.1 support RUN ./gradlew clean printVersion shadowJar -Dhtsjdk.version=4.3.0 From 9d153307cbd1790d97a029c28acbafddadbcbff8 Mon Sep 17 00:00:00 2001 From: EddieLF Date: Mon, 2 Mar 2026 16:42:46 +1100 Subject: [PATCH 5/5] Hardcode version in git clone? --- images/gatk/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/gatk/Dockerfile b/images/gatk/Dockerfile index 59be15c0..b544822b 100644 --- a/images/gatk/Dockerfile +++ b/images/gatk/Dockerfile @@ -65,7 +65,7 @@ RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages. rm -r /var/cache/apt/* # Clone GATK source code (including large files with git-lfs) and build the GATK jar file -RUN git clone --branch ${VERSION} --depth 1 https://github.com/broadinstitute/gatk.git +RUN git clone --branch 4.6.2.0 --depth 1 https://github.com/broadinstitute/gatk.git RUN git lfs install && \ git lfs pull