Skip to content

Commit a081f73

Browse files
committed
2 parents bd072fc + 83845d1 commit a081f73

File tree

1 file changed

+60
-24
lines changed

1 file changed

+60
-24
lines changed

relink-1.0.0/Dockerfile

Lines changed: 60 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,75 @@
1-
FROM python:3.12-slim
1+
FROM python:3.12-slim AS build
22

33
# Metadata
44
LABEL base_image="python:3.12-slim"
55
LABEL version="1"
66
LABEL software="relink"
77
LABEL software.version="1.0.0"
8-
LABEL about.summary="Container for relink pipeline: xiSEARCH, xiFDR, and Python dependencies for crosslinking mass spectrometry analysis"
8+
LABEL about.summary="Container for relink pipeline: xiSEARCH, xiFDR, Scout, and Dotnet / Python dependencies for crosslinking mass spectrometry analysis"
99
LABEL about.home="https://github.com/bigbio/relink"
1010
LABEL about.documentation="https://github.com/bigbio/relink"
1111
LABEL about.license="Apache-2.0"
1212
LABEL about.tags="Proteomics,Crosslinking,Mass Spectrometry"
1313
LABEL maintainer="Yasset Perez-Riverol <ypriverol@gmail.com>"
1414

1515
ENV DEBIAN_FRONTEND=noninteractive
16-
ENV PYTHONUNBUFFERED=1
17-
ENV PYTHONDONTWRITEBYTECODE=1
1816

19-
# Install Java runtime (required for xiSEARCH and xiFDR)
17+
# Build dependencies
2018
RUN apt-get update && apt-get install -y --no-install-recommends \
21-
openjdk-21-jre \
22-
wget \
23-
unzip \
24-
build-essential \
25-
libgomp1 \
26-
procps \
27-
&& rm -rf /var/lib/apt/lists/*
19+
wget \
20+
unzip \
21+
ca-certificates \
22+
&& rm -rf /var/lib/apt/lists/* && \
23+
wget https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb \
24+
-O packages-microsoft-prod.deb
2825

29-
# Create directory for xiSEARCH
30-
RUN mkdir -p /opt/xisearch
31-
32-
# Download and install xiSEARCH 1.8.11
33-
RUN wget --no-check-certificate \
26+
# Install xiSEARCH 1.8.11 and xiFDR
27+
RUN mkdir -p /opt/xisearch && wget -q \
3428
https://www.rappsilberlab.org/wp-content/uploads/2025/12/xiSEARCH_1.8.11.zip \
3529
-O /tmp/xiSEARCH.zip && \
3630
unzip /tmp/xiSEARCH.zip -d /opt/xisearch && \
3731
rm /tmp/xiSEARCH.zip && \
3832
cp /opt/xisearch/xiSEARCH_1.8.11/xiSEARCH.jar /opt/xisearch/xiSEARCH.jar && \
3933
cp /opt/xisearch/xiSEARCH_1.8.11/xiFDR-2.3.10.jar /opt/xisearch/xiFDR.jar
4034

35+
# Install Scout 2.0.0
36+
RUN mkdir -p /opt/scout && wget -q \
37+
https://github.com/diogobor/Scout/releases/download/2.0.0/Scout_Linux64.zip \
38+
-O /tmp/Scout.zip && \
39+
unzip /tmp/Scout.zip -d /opt/scout && \
40+
rm /tmp/Scout.zip && \
41+
mv /opt/scout/Scout_Linux64/* /opt/scout && \
42+
rmdir /opt/scout/Scout_Linux64
43+
44+
FROM python:3.12-slim AS runtime
45+
46+
ENV DEBIAN_FRONTEND=noninteractive
47+
ENV PYTHONUNBUFFERED=1
48+
ENV PYTHONDONTWRITEBYTECODE=1
49+
50+
# Copy necessary package for dotnet-runtime from build stage
51+
COPY --from=build packages-microsoft-prod.deb /tmp/packages-microsoft-prod.deb
52+
53+
# Install Java runtime (required for xiSEARCH and xiFDR) Dotnet runtime, MPFR, and GMP (required for Scout)
54+
RUN dpkg -i /tmp/packages-microsoft-prod.deb && \
55+
rm /tmp/packages-microsoft-prod.deb && \
56+
apt-get --allow-insecure-repositories --allow-unauthenticated update && apt-get install --allow-unauthenticated -y --no-install-recommends \
57+
dotnet-runtime-9.0 && \
58+
apt-get install -y --no-install-recommends \
59+
libmpfr6 \
60+
libgmp10 \
61+
openjdk-21-jre \
62+
&& rm -rf /var/lib/apt/lists/*
63+
64+
# Copy xiSEARCH 1.8.11 and xiFDR from build stage
65+
COPY --from=build /opt/xisearch /opt/xisearch
66+
67+
# Copy Scout 2.0.0 from build stage
68+
COPY --from=build /opt/scout /opt/scout
69+
70+
# Set necessary env for scout
71+
ENV MPFR_PATH=/usr/lib/x86_64-linux-gnu GMP_PATH=/usr/lib/x86_64-linux-gnu
72+
4173
# Install Python packages for mass recalibration
4274
# Using versions from pycross requirements.txt (pyopenms version left open for pip to resolve)
4375
RUN pip install --no-cache-dir \
@@ -62,17 +94,21 @@ RUN pip install --no-cache-dir \
6294
six==1.17.0 \
6395
tzdata==2025.2
6496

65-
# Clean up build tools (keep Java runtime)
66-
RUN apt-get remove -y wget unzip build-essential && \
67-
apt-get autoremove -y && \
68-
apt-get clean && \
69-
rm -rf /var/lib/apt/lists/*
70-
7197
# Set working directory
7298
WORKDIR /data/
7399

74100
# Verify installation
75-
RUN java -jar /opt/xisearch/xiSEARCH.jar --help || echo "xiSEARCH installed" && \
101+
RUN java -jar /opt/xisearch/xiSEARCH.jar --help 1>/dev/null && echo "xiSEARCH installed" && \
76102
ls -lh /opt/xisearch/*.jar && \
103+
set -e; \
104+
test -s /opt/scout/Scout_Unix.dll; \
105+
dotnet --info >/dev/null; \
106+
test -e /usr/lib/x86_64-linux-gnu/libgmp.so.10; \
107+
test -e /usr/lib/x86_64-linux-gnu/libmpfr.so.6; \
108+
out="$(timeout 5s dotnet /opt/scout/Scout_Unix.dll 2>&1 || true)"; \
109+
echo "$out" | head -n 20; \
110+
echo "$out" | grep -qvE "It was not possible to find any compatible framework version|Could not execute because the specified command or file was not found|A fatal error was encountered" && \
111+
echo "Scout installed" && \
112+
ls -lh /opt/scout/Scout_Unix.dll && \
77113
python -c "import pyopenms; print(f'pyopenms {pyopenms.__version__}')" && \
78114
python -c "import polars; print(f'polars {polars.__version__}')"

0 commit comments

Comments
 (0)