From 76e7cd8233d0cfeeeefe020aafc1a4c6073e6940 Mon Sep 17 00:00:00 2001 From: James Baker <59581582+jtb324@users.noreply.github.com> Date: Sat, 27 Sep 2025 15:00:44 -0500 Subject: [PATCH] Update Dockerfile IBDReduce was left out of docker at some point. This change adds it back --- Dockerfile | 38 ++++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index ed03027..5f45643 100755 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ -FROM ubuntu:22.04 AS build-container +# This build container image ends up about 3GB +FROM ubuntu:22.04 AS ibdmap-build-container RUN rm /bin/sh && ln -s /bin/bash /bin/sh @@ -31,10 +32,31 @@ RUN cmake -DCMAKE_BUILD_TYPE=Release .. # It'd be smart to detect system threads, but alas RUN make -j4 +# We need to install the necessary python dependencies +FROM ubuntu:22.04 AS ibdreduce-build-container + +RUN rm /bin/sh && ln -s /bin/bash /bin/sh + +# We need to install curl +RUN apt-get update && \ + apt-get install -y curl python3.11 python3.11-venv git && \ + rm -rf /var/lib/apt/lists/* + +WORKDIR /app + +COPY IBDReduce/requirements.txt . + +RUN python3.11 -m venv ibdreduce_venv +RUN . ibdreduce_venv/bin/activate + +ENV PATH="/app/ibdreduce_venv/bin:$PATH" +RUN pip3 install --upgrade pip && pip3 install -r requirements.txt + # Make a leaner run container without build dependencies # How much leaner is it? It's about 170MB FROM ubuntu:22.04 AS run-container +RUN rm /bin/sh && ln -s /bin/bash /bin/sh # We seem to not need libboost-numpy at runtime?! RUN apt-get update && \ apt-get -y dist-upgrade && \ @@ -43,10 +65,18 @@ RUN apt-get update && \ libboost-numpy1.74.0 \ libboost-python1.74.0 \ liblapack3 \ - libpython3.10 + libpython3.10 \ + python3.11 \ + python3.11-venv WORKDIR /app -COPY --from=build-container /app/build/ibdmap ibdmap -COPY --from=build-container /app/build/*.so . +COPY --from=ibdmap-build-container /app/build/ibdmap ibdmap +COPY --from=ibdmap-build-container /app/build/*.so . +COPY --from=ibdreduce-build-container /app/ibdreduce_venv ./ibdreduce_venv +# need to copy the scripts required for ibdreduce +COPY IBDReduce/geneticmap.py . +COPY IBDReduce/ibdreduce_v3.py . + +ENV PATH="/app/ibdreduce_venv/bin:$PATH" ENV PATH="/app:$PATH"