Skip to content

Conversation

@jBeale23
Copy link

@jBeale23 jBeale23 commented Jan 9, 2026

PR Type

Enhancement


Description

  • Added Scout 2.0.0 installation with Dotnet runtime support

  • Installed MPFR and GMP libraries required for Scout

  • Updated container summary label to reflect Scout addition

  • Enhanced verification checks for Scout installation


Diagram Walkthrough

flowchart LR
  A["Dockerfile"] -->|Install Dotnet runtime| B["Dotnet 9.0"]
  A -->|Install libraries| C["MPFR & GMP"]
  A -->|Download & extract| D["Scout 2.0.0"]
  A -->|Set environment| E["Scout paths"]
  A -->|Add verification| F["Scout health check"]
Loading

File Walkthrough

Relevant files
Enhancement
Dockerfile
Add Scout 2.0.0 with Dotnet and library support                   

relink-1.0.0/Dockerfile

  • Updated container summary label to include Scout and Dotnet
    dependencies
  • Added installation of Dotnet runtime 9.0, MPFR, and GMP libraries
    required for Scout
  • Added Scout 2.0.0 download, extraction, and installation from GitHub
    releases
  • Set environment variables for Scout library paths (mpfr_path and
    gmp_path)
  • Enhanced verification section with Scout installation check and health
    verification
  • Updated cleanup comment to reflect retained Dotnet, MPFR, and GMP
    packages
+31/-3   

Summary by CodeRabbit

  • New Features

    • Scout support added and included in the runtime image.
  • Chores

    • Runtime now includes Dotnet, Python runtimes, OpenJDK and native libraries (MPFR, GMP); environment variables set for library paths.
    • Build streamlined into separate build/runtime stages to produce a slimmer final image; installation and verification expanded to cover new components.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 9, 2026

Warning

Rate limit exceeded

@jBeale23 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 10 minutes and 55 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 3be938b and f1112f2.

📒 Files selected for processing (1)
  • relink-1.0.0/Dockerfile
📝 Walkthrough

Walkthrough

Converts relink-1.0.0/Dockerfile to a multi-stage build, adds Scout 2.0.0, installs Dotnet runtime, MPFR, GMP, and OpenJDK, sets mpfr_path and gmp_path env vars, and updates verification and metadata to include Scout and Dotnet/Python dependencies.

Changes

Cohort / File(s) Summary
Dockerfile (multi-stage)
relink-1.0.0/Dockerfile
Convert to multi-stage build with separate build and runtime stages; keep xiSEARCH/xiFDR artifacts from build to runtime.
Runtimes & libs
relink-1.0.0/Dockerfile
Add Dotnet runtime, OpenJDK, MPFR, GMP into runtime stage; set ENV mpfr_path=/usr/lib/x86_64-linux-gnu gmp_path=/usr/lib/x86_64-linux-gnu.
Scout integration
relink-1.0.0/Dockerfile
Download/unzip Scout 2.0.0 in build stage and copy into runtime; create directories and retain Scout verification in final image.
Packages, cleanup & verification
relink-1.0.0/Dockerfile
Adjust package list (remove some build tools, add ca-certificates), minimize final-stage cleanup, and extend verification steps to include scout and dotnet.
Metadata
relink-1.0.0/Dockerfile
Update LABEL about.summary to mention Scout and Dotnet / Python dependencies.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I nudged a Dockerfile, neat and light,
Slid Scout and Dotnet into the night,
MPFR and GMP paths placed just right,
Java and xiSEARCH tucked out of sight,
Hop—image built, ready for flight 🚀

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title directly aligns with the main changeset objective: adding Scout 2.0.0 and its required dependencies (Dotnet runtime, MPFR, GMP libraries) to the Relink Dockerfile.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@qodo-code-review
Copy link

qodo-code-review bot commented Jan 9, 2026

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
Supply chain risk

Description: The Dockerfile introduces supply-chain risk by downloading and executing/installing
externally hosted artifacts (Microsoft APT repo bootstrap .deb and the Scout GitHub
release zip) without checksum/signature pinning, and it disables TLS certificate
verification for the Scout download via wget --no-check-certificate, which could allow a
MitM to deliver a malicious payload.
Dockerfile [29-62]

Referred Code
# Install Dotnet runtime, MPFR, and GMP (required for Scout)
RUN wget https://packages.microsoft.com/config/debian/13/packages-microsoft-prod.deb \
	-O packages-microsoft-prod.deb && \
	dpkg -i packages-microsoft-prod.deb && \
	rm packages-microsoft-prod.deb && \
	apt-get update && apt-get install -y --no-install-recommends \
	dotnet-runtime-9.0 \
	libmpfr-dev \
	libgmp-dev \
    && rm -rf /var/lib/apt/lists/*

# Create directory for xiSEARCH
RUN mkdir -p /opt/xisearch

# Download and install xiSEARCH 1.8.11
RUN wget --no-check-certificate \
    https://www.rappsilberlab.org/wp-content/uploads/2025/12/xiSEARCH_1.8.11.zip \
    -O /tmp/xiSEARCH.zip && \
    unzip /tmp/xiSEARCH.zip -d /opt/xisearch && \
    rm /tmp/xiSEARCH.zip && \
    cp /opt/xisearch/xiSEARCH_1.8.11/xiSEARCH.jar /opt/xisearch/xiSEARCH.jar && \


 ... (clipped 13 lines)
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

🔴
Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status:
TLS verification disabled: The new wget --no-check-certificate usage disables TLS certificate verification when
downloading Scout, allowing potential MITM tampering of externally sourced binaries.

Referred Code
RUN wget --no-check-certificate \
	https://github.com/diogobor/Scout/releases/download/2.0.0/Scout_Linux64.zip \
	-O /tmp/Scout.zip && \

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status:
Nonstandard env naming: The new environment variable names mpfr_path and gmp_path are not self-documenting and
deviate from conventional uppercase ENV naming, reducing clarity and discoverability.

Referred Code
ENV mpfr_path=/usr/lib/x86_64-linux-gnu gmp_path=/usr/lib/x86_64-linux-gnu

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status:
Missing install validation: The new external dependency install steps (Dotnet/Scout) do not include integrity
validation (e.g., checksums/signature checks), which can lead to brittle builds and
hard-to-diagnose failures.

Referred Code
RUN wget https://packages.microsoft.com/config/debian/13/packages-microsoft-prod.deb \
	-O packages-microsoft-prod.deb && \
	dpkg -i packages-microsoft-prod.deb && \
	rm packages-microsoft-prod.deb && \
	apt-get update && apt-get install -y --no-install-recommends \
	dotnet-runtime-9.0 \
	libmpfr-dev \
	libgmp-dev \
    && rm -rf /var/lib/apt/lists/*

# Create directory for xiSEARCH
RUN mkdir -p /opt/xisearch

# Download and install xiSEARCH 1.8.11
RUN wget --no-check-certificate \
    https://www.rappsilberlab.org/wp-content/uploads/2025/12/xiSEARCH_1.8.11.zip \
    -O /tmp/xiSEARCH.zip && \
    unzip /tmp/xiSEARCH.zip -d /opt/xisearch && \
    rm /tmp/xiSEARCH.zip && \
    cp /opt/xisearch/xiSEARCH_1.8.11/xiSEARCH.jar /opt/xisearch/xiSEARCH.jar && \
    cp /opt/xisearch/xiSEARCH_1.8.11/xiFDR-2.3.10.jar /opt/xisearch/xiFDR.jar


 ... (clipped 12 lines)

Learn more about managing compliance generic rules or creating your own custom rules

  • Update
Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-code-review
Copy link

qodo-code-review bot commented Jan 9, 2026

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
High-level
Adopt a multi-stage Docker build
Suggestion Impact:The Dockerfile was converted to a multi-stage build with a "build" stage that downloads/unzips xiSEARCH and Scout (using wget/unzip) and a separate "runtime" stage that installs only runtime dependencies (Java, dotnet-runtime, mpfr/gmp runtime libs) and copies the built artifacts from the build stage. This aligns with the suggestion to exclude build-time tooling from the final image.

code diff:

-FROM python:3.12-slim
+FROM python:3.12-slim AS build
 
 # Metadata
 LABEL base_image="python:3.12-slim"
@@ -13,35 +13,18 @@
 LABEL maintainer="Yasset Perez-Riverol <[email protected]>"
 
 ENV DEBIAN_FRONTEND=noninteractive
-ENV PYTHONUNBUFFERED=1
-ENV PYTHONDONTWRITEBYTECODE=1
 
-# Install Java runtime (required for xiSEARCH and xiFDR)
+# Build dependencies
 RUN apt-get update && apt-get install -y --no-install-recommends \
-    openjdk-21-jre \
-    wget \
-    unzip \
-    build-essential \
-    libgomp1 \
-    procps \
-    && rm -rf /var/lib/apt/lists/*
+	wget \
+	unzip \
+	ca-certificates \
+	&& rm -rf /var/lib/apt/lists/* && \
+	wget https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb \
+	-O packages-microsoft-prod.deb
 
-# Install Dotnet runtime, MPFR, and GMP (required for Scout)
-RUN wget https://packages.microsoft.com/config/debian/13/packages-microsoft-prod.deb \
-	-O packages-microsoft-prod.deb && \
-	dpkg -i packages-microsoft-prod.deb && \
-	rm packages-microsoft-prod.deb && \
-	apt-get update && apt-get install -y --no-install-recommends \
-	dotnet-runtime-9.0 \
-	libmpfr-dev \
-	libgmp-dev \
-    && rm -rf /var/lib/apt/lists/*
-
-# Create directory for xiSEARCH
-RUN mkdir -p /opt/xisearch
-
-# Download and install xiSEARCH 1.8.11
-RUN wget --no-check-certificate \
+# Install xiSEARCH 1.8.11 and xiFDR
+RUN mkdir -p /opt/xisearch && wget -q \
     https://www.rappsilberlab.org/wp-content/uploads/2025/12/xiSEARCH_1.8.11.zip \
     -O /tmp/xiSEARCH.zip && \
     unzip /tmp/xiSEARCH.zip -d /opt/xisearch && \
@@ -49,17 +32,44 @@
     cp /opt/xisearch/xiSEARCH_1.8.11/xiSEARCH.jar /opt/xisearch/xiSEARCH.jar && \
     cp /opt/xisearch/xiSEARCH_1.8.11/xiFDR-2.3.10.jar /opt/xisearch/xiFDR.jar
 
-# Create directory for Scout
-RUN mkdir -p /opt/scout
-
-# Download and install Scout 2.0.0
-RUN wget --no-check-certificate \
+# Install Scout 2.0.0
+RUN mkdir -p /opt/scout && wget -q \
 	https://github.com/diogobor/Scout/releases/download/2.0.0/Scout_Linux64.zip \
 	-O /tmp/Scout.zip && \
 	unzip /tmp/Scout.zip -d /opt/scout && \
 	rm /tmp/Scout.zip && \
 	mv /opt/scout/Scout_Linux64/* /opt/scout && \
 	rmdir /opt/scout/Scout_Linux64
+
+# Clean up build tools
+RUN apt-get remove -y wget unzip ca-certificates && \
+    apt-get autoremove -y && \
+    apt-get clean && \
+    rm -rf /var/lib/apt/lists/*
+
+FROM python:3.12-slim AS runtime
+
+ENV DEBIAN_FRONTEND=noninteractive
+ENV PYTHONUNBUFFERED=1
+ENV PYTHONDONTWRITEBYTECODE=1
+
+COPY --from=build packages-microsoft-prod.deb packages-microsoft-prod.deb
+
+# Install Java runtime (required for xiSEARCH and xiFDR) Dotnet runtime, MPFR, and GMP (required for Scout)
+RUN dpkg -i packages-microsoft-prod.deb && \
+	rm packages-microsoft-prod.deb && \
+	apt-get update && apt-get install -y --no-install-recommends \
+	dotnet-runtime-9.0 \
+	libmpfr6 \
+	libgmp10 \
+	openjdk-21-jre \
+    && rm -rf /var/lib/apt/lists/*
+
+# Copy xiSEARCH 1.8.11 and xiFDR from build stage
+COPY --from=build /opt/xisearch /opt/xisearch
+
+# Copy Scout 2.0.0 from build stage
+COPY --from=build /opt/scout /opt/scout 

Refactor the Dockerfile to use a multi-stage build. This separates the build
environment from the runtime environment, resulting in a smaller and more secure
final image by excluding build-time dependencies.

Examples:

relink-1.0.0/Dockerfile [20-95]
RUN apt-get update && apt-get install -y --no-install-recommends \
    openjdk-21-jre \
    wget \
    unzip \
    build-essential \
    libgomp1 \
    procps \
    && rm -rf /var/lib/apt/lists/*

# Install Dotnet runtime, MPFR, and GMP (required for Scout)

 ... (clipped 66 lines)

Solution Walkthrough:

Before:

FROM python:3.12-slim

# Install all dependencies (runtime and build-time)
RUN apt-get update && apt-get install -y \
    openjdk-21-jre \
    wget unzip build-essential \
    dotnet-runtime-9.0 \
    libmpfr-dev libgmp-dev

# Download and install tools using wget/unzip
RUN wget ... && unzip ... && rm ...
RUN wget ... && unzip ... && rm ...

# Install python packages
RUN pip install ...

# Attempt to clean up build-time dependencies
RUN apt-get remove -y wget unzip build-essential

WORKDIR /data/

After:

# Build stage
FROM python:3.12-slim AS builder

# Install build-time dependencies
RUN apt-get update && apt-get install -y wget unzip ...

# Download and extract tools
RUN mkdir /opt/xisearch && wget ... -O /tmp/xi.zip && unzip /tmp/xi.zip -d /opt/xisearch
RUN mkdir /opt/scout && wget ... -O /tmp/scout.zip && unzip /tmp/scout.zip -d /opt/scout

# Final stage
FROM python:3.12-slim

# Install only runtime dependencies
RUN apt-get update && apt-get install -y \
    openjdk-21-jre \
    dotnet-runtime-9.0 \
    libmpfr6 libgmp10

# Copy artifacts from builder stage
COPY --from=builder /opt/xisearch /opt/xisearch
COPY --from=builder /opt/scout /opt/scout
...
Suggestion importance[1-10]: 9

__

Why: This is an excellent suggestion that proposes a fundamental improvement to the Dockerfile's structure, aligning it with best practices to create smaller, more secure, and more maintainable container images.

High
Possible issue
Align Debian repository with base image
Suggestion Impact:The Dockerfile was updated to download packages-microsoft-prod.deb from the Debian 12 configuration URL instead of Debian 13, matching the base image OS version.

code diff:

-RUN wget https://packages.microsoft.com/config/debian/13/packages-microsoft-prod.deb \
+RUN wget https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb \

Change the Debian repository version from 13 to 12 in the wget command to match
the python:3.12-slim base image's operating system.

relink-1.0.0/Dockerfile [30-38]

-RUN wget https://packages.microsoft.com/config/debian/13/packages-microsoft-prod.deb \
+RUN wget https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb \
 	-O packages-microsoft-prod.deb && \
 	dpkg -i packages-microsoft-prod.deb && \
 	rm packages-microsoft-prod.deb && \
 	apt-get update && apt-get install -y --no-install-recommends \
 	dotnet-runtime-9.0 \
 	libmpfr-dev \
 	libgmp-dev \
     && rm -rf /var/lib/apt/lists/*

[Suggestion processed]

Suggestion importance[1-10]: 9

__

Why: The suggestion correctly identifies a critical stability risk by pointing out the mismatch between the base image's Debian version (12) and the configured package repository version (13), preventing potential dependency conflicts.

High
General
Use runtime libraries instead of development packages
Suggestion Impact:The Dockerfile install list was updated to use libmpfr6 and libgmp10 instead of libmpfr-dev and libgmp-dev, matching the optimization suggested to avoid dev packages in the final image.

code diff:

 	apt-get update && apt-get install -y --no-install-recommends \
 	dotnet-runtime-9.0 \
-	libmpfr-dev \
-	libgmp-dev \
+	libmpfr6 \
+	libgmp10 \
     && rm -rf /var/lib/apt/lists/*

Replace development packages libmpfr-dev and libgmp-dev with their runtime-only
equivalents, libmpfr6 and libgmp10, to reduce the final Docker image size.

relink-1.0.0/Dockerfile [30-38]

 RUN wget https://packages.microsoft.com/config/debian/13/packages-microsoft-prod.deb \
 	-O packages-microsoft-prod.deb && \
 	dpkg -i packages-microsoft-prod.deb && \
 	rm packages-microsoft-prod.deb && \
 	apt-get update && apt-get install -y --no-install-recommends \
 	dotnet-runtime-9.0 \
-	libmpfr-dev \
-	libgmp-dev \
+	libmpfr6 \
+	libgmp10 \
     && rm -rf /var/lib/apt/lists/*

[Suggestion processed]

Suggestion importance[1-10]: 6

__

Why: This is a good optimization that reduces the Docker image size by correctly suggesting to use runtime libraries instead of development packages, which is a best practice.

Low
Standardize environment variable names
Suggestion Impact:The Dockerfile was updated to use uppercase environment variable names (MPFR_PATH and GMP_PATH) instead of mpfr_path and gmp_path. However, they were not split onto separate lines with a backslash as suggested; they remain on a single ENV line.

code diff:

 # Set necessary env for scout
-ENV mpfr_path=/usr/lib/x86_64-linux-gnu gmp_path=/usr/lib/x86_64-linux-gnu
+ENV MPFR_PATH=/usr/lib/x86_64-linux-gnu GMP_PATH=/usr/lib/x86_64-linux-gnu
 

Change the environment variable names mpfr_path and gmp_path to uppercase
(MPFR_PATH, GMP_PATH) and declare them on separate lines for better readability
and to follow convention.

relink-1.0.0/Dockerfile [65]

-ENV mpfr_path=/usr/lib/x86_64-linux-gnu gmp_path=/usr/lib/x86_64-linux-gnu
+ENV MPFR_PATH=/usr/lib/x86_64-linux-gnu \
+    GMP_PATH=/usr/lib/x86_64-linux-gnu

[Suggestion processed]

Suggestion importance[1-10]: 4

__

Why: The suggestion improves code readability and adheres to the common convention of using uppercase for environment variables, which enhances maintainability.

Low
  • Update

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @relink-1.0.0/Dockerfile:
- Around line 56-62: The Dockerfile RUN block currently uses wget with the
--no-check-certificate flag to fetch Scout_Linux64.zip (and similar for the
xiSEARCH download); remove the --no-check-certificate flag, ensure the image
installs and updates ca-certificates (e.g., add installation of the
ca-certificates package earlier in the Dockerfile), and replace the wget
invocation with a robust downloader invocation (e.g., wget or curl with strict
TLS validation and retry/fail flags) for the Scout URL to restore proper SSL
verification and error handling during the RUN that downloads/unzips/moves
/tmp/Scout.zip.
🧹 Nitpick comments (2)
relink-1.0.0/Dockerfile (2)

64-65: Architecture-specific path hardcoded.

The library path /usr/lib/x86_64-linux-gnu is hardcoded for x86_64 architecture. This will break if the container is built for ARM64 or other architectures.

If multi-architecture support is desired, consider using $(dpkg-architecture -qDEB_HOST_MULTIARCH) during build, or document that this image is x86_64-only.

💡 Alternative: Dynamic architecture detection at build time
-# Set necessary env for scout
-ENV mpfr_path=/usr/lib/x86_64-linux-gnu gmp_path=/usr/lib/x86_64-linux-gnu
+# Set necessary env for scout (x86_64 only)
+ARG TARGETARCH=amd64
+ENV mpfr_path=/usr/lib/x86_64-linux-gnu
+ENV gmp_path=/usr/lib/x86_64-linux-gnu

Alternatively, if x86_64 is the only supported platform, add a comment documenting this constraint.


34-38: Consider using runtime packages instead of -dev packages to reduce image size.

The -dev packages (libmpfr-dev, libgmp-dev) include development headers and static libraries that are not needed at runtime. Scout uses .NET P/Invoke to call the C libraries, which only requires the shared library files. Using libmpfr6 and libgmp10 instead will reduce the final image size without affecting functionality.

💡 Suggested change
 	apt-get update && apt-get install -y --no-install-recommends \
 	dotnet-runtime-9.0 \
-	libmpfr-dev \
-	libgmp-dev \
+	libmpfr6 \
+	libgmp10 \
     && rm -rf /var/lib/apt/lists/*
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7b7a802 and 812ddf8.

📒 Files selected for processing (1)
  • relink-1.0.0/Dockerfile
🧰 Additional context used
🪛 Checkov (3.2.334)
relink-1.0.0/Dockerfile

[high] 56-62: Ensure that certificate validation isn't disabled with wget

(CKV2_DOCKER_3)

🔇 Additional comments (3)
relink-1.0.0/Dockerfile (3)

8-8: LGTM!

The updated summary accurately reflects the container's new capabilities with Scout and Dotnet dependencies.


91-95: LGTM!

The cleanup step appropriately removes build tools while preserving the required runtime dependencies, and the comment accurately reflects this.


101-104: LGTM!

Good practice to verify Scout installation during the build. The version check (grep -q "Scout - v. 2.0.0") ensures the correct version is installed.

Copy link
Collaborator

@TinyMarsh TinyMarsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a review FWIW :)

Some suggestions not strictly related to your changes but probably worth addressing.

Overall the resulting Docker image is quite large, and I'm not sure it needs to be. Probably worth addressing that at some point. In that regard I like qodo-code-review bot's suggestion of a multi-stage build.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @relink-1.0.0/Dockerfile:
- Around line 29-38: The Dockerfile is fetching Microsoft packages for Debian 13
while the base image python:3.12-slim is Debian 12; update the RUN block that
downloads packages-microsoft-prod.deb (the wget/dpkg/apt-get install sequence)
to use the Debian 12 Microsoft package repository (change the URL from
.../config/debian/13/... to .../config/debian/12/...) and then install the
appropriate dotnet runtime package (keep reference to dotnet-runtime-9.0 in the
apt-get install list only if that runtime is available for Debian 12, otherwise
select the matching runtime package), leaving the rest of the install steps
(libmpfr-dev, libgmp-dev, and cleanup) unchanged.
🧹 Nitpick comments (3)
relink-1.0.0/Dockerfile (3)

52-62: Consider verifying download integrity with a checksum.

The Scout archive is downloaded without verifying its integrity. Adding checksum verification would protect against corrupted downloads or supply-chain attacks.

Example: Add SHA256 checksum verification
 # Download and install Scout 2.0.0
 RUN wget -q \
 	https://github.com/diogobor/Scout/releases/download/2.0.0/Scout_Linux64.zip \
 	-O /tmp/Scout.zip && \
+	echo "<expected_sha256_hash>  /tmp/Scout.zip" | sha256sum -c - && \
 	unzip /tmp/Scout.zip -d /opt/scout && \

You'll need to obtain the correct SHA256 hash from a trusted source or calculate it from a verified download.


30-38: Inconsistent indentation: new code uses tabs while existing code uses spaces.

The new RUN commands use tabs for continuation line indentation, while the original file uses 4 spaces. Consider aligning with the existing style for consistency.

Example: Convert tabs to 4 spaces
 # Install Dotnet runtime, MPFR, and GMP (required for Scout)
 RUN wget https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb \
-	-O packages-microsoft-prod.deb && \
-	dpkg -i packages-microsoft-prod.deb && \
-	rm packages-microsoft-prod.deb && \
-	apt-get update && apt-get install -y --no-install-recommends \
-	dotnet-runtime-9.0 \
-	libmpfr-dev \
-	libgmp-dev \
+    -O packages-microsoft-prod.deb && \
+    dpkg -i packages-microsoft-prod.deb && \
+    rm packages-microsoft-prod.deb && \
+    apt-get update && apt-get install -y --no-install-recommends \
+    dotnet-runtime-9.0 \
+    libmpfr6 \
+    libgmp10 \
     && rm -rf /var/lib/apt/lists/*

36-37: Use runtime-only packages instead of development packages to reduce image size.

Scout is a precompiled .NET binary and only requires the shared libraries at runtime, not the development headers and static libraries included in libmpfr-dev and libgmp-dev. Replace them with the runtime-only packages libmpfr6 and libgmp10:

Proposed fix
 	apt-get update && apt-get install -y --no-install-recommends \
 	dotnet-runtime-9.0 \
-	libmpfr-dev \
-	libgmp-dev \
+	libmpfr6 \
+	libgmp10 \
     && rm -rf /var/lib/apt/lists/*
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 812ddf8 and 2b117e8.

📒 Files selected for processing (1)
  • relink-1.0.0/Dockerfile
🔇 Additional comments (4)
relink-1.0.0/Dockerfile (4)

8-8: LGTM!

The updated summary label accurately reflects the new Scout and Dotnet dependencies added to the container.


64-65: LGTM!

The environment variables correctly point to the standard Debian library path for x86_64. This is consistent with the x86_64-specific Scout binary being downloaded.


91-95: LGTM!

Good practice to remove wget and unzip after use to reduce attack surface. The comment accurately documents the retained dependencies.


100-106: LGTM!

Good practice to verify installations at build time. The Scout version check with grep -q "Scout - v. 2.0.0" ensures the correct version is installed and will fail the build if verification fails.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @relink-1.0.0/Dockerfile:
- Around line 101-105: The RUN step currently verifies Scout by grepping for the
exact string "ERROR: Please specify the following arguments:" from the output of
dotnet /opt/scout/Scout_Unix.dll which is fragile; change the verification to
assert that the DLL is executable by dotnet and returns a usable help/usage exit
(or simply prints a usage/usage-like token) instead of matching exact error text
— replace the grep of "ERROR: Please specify the following arguments:" with a
robust check such as invoking dotnet /opt/scout/Scout_Unix.dll --help (or
--version) and verifying a non-empty output or a successful exit code, and keep
the existing echo "Scout installed" only when that invocation succeeds; target
the RUN line containing dotnet /opt/scout/Scout_Unix.dll to make this change.
🧹 Nitpick comments (1)
relink-1.0.0/Dockerfile (1)

29-38: Inconsistent indentation style.

This block uses tabs while other RUN commands in the file use spaces. Consider aligning with the file's existing style for consistency.

♻️ Proposed fix for consistent indentation
 # Install Dotnet runtime, MPFR, and GMP (required for Scout)
 RUN wget https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb \
-	-O packages-microsoft-prod.deb && \
-	dpkg -i packages-microsoft-prod.deb && \
-	rm packages-microsoft-prod.deb && \
-	apt-get update && apt-get install -y --no-install-recommends \
-	dotnet-runtime-9.0 \
-	libmpfr6 \
-	libgmp10 \
+    -O packages-microsoft-prod.deb && \
+    dpkg -i packages-microsoft-prod.deb && \
+    rm packages-microsoft-prod.deb && \
+    apt-get update && apt-get install -y --no-install-recommends \
+    dotnet-runtime-9.0 \
+    libmpfr6 \
+    libgmp10 \
     && rm -rf /var/lib/apt/lists/*
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2b117e8 and f46cc69.

📒 Files selected for processing (1)
  • relink-1.0.0/Dockerfile
🔇 Additional comments (5)
relink-1.0.0/Dockerfile (5)

8-8: LGTM!

The summary label accurately reflects the added Scout and Dotnet dependencies.


64-65: Architecture-specific path may break on non-x86_64 builds.

The hardcoded path /usr/lib/x86_64-linux-gnu is specific to x86_64 architecture. If this container needs to support ARM64 (aarch64), the path would be /usr/lib/aarch64-linux-gnu. Consider using architecture-agnostic paths or dynamically determining the library path.

If multi-arch support is not required, this is fine as-is. Otherwise, consider:

♻️ Suggested fix for multi-arch support
-ENV mpfr_path=/usr/lib/x86_64-linux-gnu gmp_path=/usr/lib/x86_64-linux-gnu
+ENV mpfr_path=/usr/lib/${TARGETARCH}-linux-gnu gmp_path=/usr/lib/${TARGETARCH}-linux-gnu

Or determine at runtime:

ENV mpfr_path=/usr/lib gmp_path=/usr/lib
# Scout should search standard library paths

91-95: LGTM!

Good practice to remove build-only tools (wget, unzip) while retaining runtime dependencies. The comment accurately documents what remains.


44-50: LGTM!

The -q flag addition provides cleaner build output, consistent with the Scout download command.


55-62: Scout 2.0.0 release URL is valid and accessible.

The specified GitHub release exists and the Scout_Linux64.zip asset is available. The installation logic correctly downloads, extracts, and cleans up temporary files. Note that the Scout project does not provide official checksums in their releases, making checksum validation impractical without external sources or local maintenance.

Likely an incorrect or invalid review comment.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @relink-1.0.0/Dockerfile:
- Around line 74-75: The Dockerfile ENV line sets lowercase environment
variables mpfr_path and gmp_path which Scout won't recognize; update the ENV
declaration to export uppercase variables MPFR_PATH and GMP_PATH (replace
mpfr_path and gmp_path in the ENV statement) so Scout can find the MPFR and GMP
libraries, keeping the same paths.
🧹 Nitpick comments (4)
relink-1.0.0/Dockerfile (4)

17-24: Consider adding checksum verification for downloaded packages.

The Microsoft packages .deb file is downloaded without checksum verification. While this is common practice, adding verification would improve supply chain security.


44-48: Cleanup in build stage is unnecessary with multi-stage builds.

Since this is a multi-stage build and only the specific artifacts (/opt/xisearch, /opt/scout, and the .deb file) are copied to the runtime stage, this cleanup step doesn't reduce the final image size. Consider removing it to simplify the Dockerfile.

♻️ Suggested simplification
-# Clean up build tools
-RUN apt-get remove -y wget unzip ca-certificates && \
-    apt-get autoremove -y && \
-    apt-get clean && \
-    rm -rf /var/lib/apt/lists/*
-
 FROM python:3.12-slim AS runtime

77-80: Consider pinning pyopenms version for reproducible builds.

All other Python packages have pinned versions, but pyopenms is left unpinned. This could lead to non-reproducible builds if a new pyopenms version introduces breaking changes or incompatibilities.

♻️ Suggested fix
 RUN pip install --no-cache-dir \
-    pyopenms \
+    pyopenms==3.x.x \  # Pin to a specific version
     polars==1.35.1 \

107-109: Fragile verification logic for Scout installation.

The verification relies on Scout outputting exactly one line containing "ERROR" and a specific error message. This is brittle - if Scout's output format changes in future versions, the build will fail even though Scout is correctly installed.

Consider a more robust approach, such as checking for the existence of the binary and verifying it runs without crashing:

♻️ Suggested improvement
-	test $(dotnet /opt/scout/Scout_Unix.dll | grep "ERROR" | wc -l) -eq 1 && \
-	dotnet /opt/scout/Scout_Unix.dll | grep "ERROR: Please specify the following arguments:" && echo "Scout installed" && \
-	ls -lh /opt/scout/Scout_Unix.dll && \
+	dotnet /opt/scout/Scout_Unix.dll --help >/dev/null 2>&1 || true && \
+	test -f /opt/scout/Scout_Unix.dll && echo "Scout installed" && \
+	ls -lh /opt/scout/Scout_Unix.dll && \

Alternatively, if you need to verify Scout runs correctly, check for a non-error exit or specific success indicator rather than counting ERROR lines.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f46cc69 and bb02cc5.

📒 Files selected for processing (1)
  • relink-1.0.0/Dockerfile
🔇 Additional comments (4)
relink-1.0.0/Dockerfile (4)

1-13: LGTM!

The multi-stage build setup and updated metadata labels correctly reflect the addition of Scout and Dotnet dependencies.


26-33: LGTM!

The xiSEARCH and xiFDR installation follows standard patterns for downloading and extracting software in Docker builds.


35-42: LGTM!

Scout 2.0.0 installation is clean, with proper directory flattening after extraction.


50-66: LGTM!

The runtime stage correctly installs all required dependencies for Scout (dotnet, MPFR, GMP) and xiSEARCH/xiFDR (OpenJDK), with proper cleanup of apt lists.

…h naming schema, as Scout's recognition of these variables appears to be case insensitive.
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (3)
relink-1.0.0/Dockerfile (3)

17-24: Consider explicit path for downloaded file.

The Microsoft .deb file is downloaded to the implicit working directory (/). While this works, using an explicit path (e.g., /tmp/packages-microsoft-prod.deb) would be clearer and more maintainable.


73-74: Consider pinning pyopenms version for reproducibility.

All other packages have pinned versions, but pyopenms is unpinned. This could lead to build inconsistencies if a breaking version is released.

Suggested fix
 RUN pip install --no-cache-dir \
-    pyopenms \
+    pyopenms==3.x.x \  # Pin to tested version

99-103: Scout verification is fragile.

The verification logic expects exactly one ERROR line in Scout's output, which is brittle:

  • If Scout's output format changes, this check will break the build.
  • The double grep "ERROR" is redundant (line 101 counts ERRORs, line 102 greps again).

Consider a more robust check that simply verifies Scout runs and produces expected output:

Suggested fix
-RUN java -jar /opt/xisearch/xiSEARCH.jar --help 1>/dev/null && echo "xiSEARCH installed" && \
-    ls -lh /opt/xisearch/*.jar && \
-	test $(dotnet /opt/scout/Scout_Unix.dll | grep "ERROR" | wc -l) -eq 1 && \
-	dotnet /opt/scout/Scout_Unix.dll | grep "ERROR: Please specify the following arguments:" && echo "Scout installed" && \
-	ls -lh /opt/scout/Scout_Unix.dll && \
+RUN java -jar /opt/xisearch/xiSEARCH.jar --help 1>/dev/null && echo "xiSEARCH installed" && \
+    ls -lh /opt/xisearch/*.jar && \
+    dotnet /opt/scout/Scout_Unix.dll 2>&1 | grep -q "Please specify the following arguments" && echo "Scout installed" && \
+    ls -lh /opt/scout/Scout_Unix.dll && \
     python -c "import pyopenms; print(f'pyopenms {pyopenms.__version__}')" && \
     python -c "import polars; print(f'polars {polars.__version__}')"
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bb02cc5 and 3be938b.

📒 Files selected for processing (1)
  • relink-1.0.0/Dockerfile
🔇 Additional comments (6)
relink-1.0.0/Dockerfile (6)

1-13: LGTM!

Multi-stage build setup with comprehensive metadata labels. The summary accurately reflects the container's expanded capabilities with Scout and Dotnet dependencies.


26-33: LGTM!

xiSEARCH installation follows best practices: downloads to temp, extracts, copies required JARs, and cleans up.


35-42: LGTM!

Scout installation correctly downloads from GitHub releases, extracts, and flattens the directory structure.


68-69: Architecture-specific library paths.

The hardcoded path /usr/lib/x86_64-linux-gnu assumes x86_64 architecture. If ARM/aarch64 builds are planned, this path would need adjustment (e.g., /usr/lib/aarch64-linux-gnu).

This is fine if the container is x86_64-only, which aligns with the Scout_Linux64.zip download.


75-76: polars-runtime-32 package verified on PyPI.

The package polars-runtime-32==1.35.1 does exist on PyPI as a legitimate package with the summary "Blazingly fast DataFrame library." While this separate runtime package is unusual for typical Polars usage, it appears to be an intentional dependency in this context. No action needed.


44-60: LGTM! Runtime stage is well-configured.

The multi-stage build keeps the final image lean with appropriate dependencies. dotnet-runtime-9.0 satisfies Scout 2.0.0's requirement for .NET 9 or later, and openjdk-21-jre is correct for xiSEARCH. Proper cleanup of apt lists is in place.

@jBeale23 jBeale23 requested a review from TinyMarsh January 12, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants