Skip to content
Merged
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
38 changes: 34 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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 && \
Expand All @@ -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"
Loading