Mercurial > repos > jpayne > refchooser
comparison Dockerfile @ 2:719889ec4e14 draft
planemo upload commit 92689f52a93241194941ecf374629245c8fb9093
| author | galaxytrakr |
|---|---|
| date | Mon, 16 Mar 2026 15:02:07 +0000 |
| parents | |
| children | a657c8343dd0 |
comparison
equal
deleted
inserted
replaced
| 1:dcf6c2409ebb | 2:719889ec4e14 |
|---|---|
| 1 # ============================================================= | |
| 2 # Dockerfile for refchooser (compatible with Galaxy) | |
| 3 # ============================================================= | |
| 4 | |
| 5 # ---------- Build Stage 1: The "Builder" ---------- | |
| 6 # This stage downloads and prepares all our dependencies. | |
| 7 FROM ubuntu:20.04 AS builder | |
| 8 | |
| 9 # Set versions for our tools to make updates easy. | |
| 10 ARG MASH_VER="2.3" | |
| 11 ARG PYTHON_VER="3.8" | |
| 12 | |
| 13 # Avoid interactive prompts during apt-get install. | |
| 14 ENV DEBIAN_FRONTEND=noninteractive | |
| 15 | |
| 16 # Install all the dependencies needed to build our tools. | |
| 17 RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| 18 wget \ | |
| 19 tar \ | |
| 20 gzip \ | |
| 21 python${PYTHON_VER} \ | |
| 22 python${PYTHON_VER}-venv \ | |
| 23 && rm -rf /var/lib/apt/lists/* | |
| 24 | |
| 25 # Set a working directory for our downloads. | |
| 26 WORKDIR /build | |
| 27 | |
| 28 # --- Install Mash --- | |
| 29 # Download the pre-compiled Linux binary for Mash. | |
| 30 ADD https://github.com/marbl/Mash/releases/download/v${MASH_VER}/mash-Linux64-v${MASH_VER}.tar . | |
| 31 # Unpack the tarball, find the 'mash' executable, and install it to a standard location. | |
| 32 RUN tar -xvf mash-Linux64-v${MASH_VER}.tar && \ | |
| 33 install -m 0755 mash-Linux64-v${MASH_VER}/mash /usr/local/bin/mash | |
| 34 | |
| 35 # --- Install refchooser --- | |
| 36 # Create a Python virtual environment in a standard location. | |
| 37 RUN python${PYTHON_VER} -m venv /opt/venv | |
| 38 # Activate the venv and install refchooser and its dependencies using pip. | |
| 39 ENV PATH="/opt/venv/bin:$PATH" | |
| 40 RUN pip install --no-cache-dir refchooser | |
| 41 | |
| 42 | |
| 43 # ---------- Build Stage 2: The "Runtime" Stage ---------- | |
| 44 # This is our final, lean image that will be used by Galaxy. | |
| 45 FROM ubuntu:20.04 AS runtime | |
| 46 | |
| 47 # Avoid interactive prompts. | |
| 48 ENV DEBIAN_FRONTEND=noninteractive | |
| 49 | |
| 50 # Install only the essential runtime libraries needed by Mash and Python. | |
| 51 RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| 52 libgomp1 \ | |
| 53 python3.8-venv \ | |
| 54 && rm -rf /var/lib/apt/lists/* | |
| 55 | |
| 56 # --- Copy Binaries and Environment from Builder Stage --- | |
| 57 | |
| 58 # Copy the compiled 'mash' binary from the builder stage. | |
| 59 COPY --from=builder /usr/local/bin/mash /usr/local/bin/mash | |
| 60 | |
| 61 # Copy the entire Python virtual environment containing 'refchooser'. | |
| 62 COPY --from=builder /opt/venv /opt/venv | |
| 63 | |
| 64 # --- Final Configuration --- | |
| 65 | |
| 66 # Set the PATH environment variable so the system can find 'mash' and 'refchooser'. | |
| 67 ENV PATH="/opt/venv/bin:$PATH" | |
| 68 | |
| 69 # As a best practice for Galaxy, ensure all users can read and execute the tools. | |
| 70 RUN chmod -R a+rX /opt/venv && \ | |
| 71 chmod a+rx /usr/local/bin/mash | |
| 72 | |
| 73 # IMPORTANT: No ENTRYPOINT. Set a neutral CMD for Galaxy compatibility. | |
| 74 CMD ["/bin/bash"] |
