-
Notifications
You must be signed in to change notification settings - Fork 67
Expand file tree
/
Copy pathDockerfile.mega
More file actions
66 lines (56 loc) · 3.56 KB
/
Dockerfile.mega
File metadata and controls
66 lines (56 loc) · 3.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# viral-ngs mega image
# Builds on core, adds ALL tools (assembly, classification, phylogenetics)
#
# This provides:
# - All core bioinformatics tools (from core image)
# - All assembly tools (SPAdes, MUMmer, MAFFT, skani, etc.)
# - All classification tools (Kraken2, BLAST, BMTagger, KMC, etc.)
# - All phylogenetics tools (LoFreq, SnpEff, MUSCLE, V-Phaser2, etc.)
#
# Usage:
# docker build --build-arg BASEIMAGE=quay.io/broadinstitute/viral-ngs:main-core -t viral-ngs:mega -f docker/Dockerfile.mega .
ARG BASEIMAGE=quay.io/broadinstitute/viral-ngs:main-core
FROM ${BASEIMAGE}
LABEL maintainer="viral-ngs@broadinstitute.org"
LABEL org.opencontainers.image.source="https://github.com/broadinstitute/viral-ngs"
# Enable conda environment activation for RUN commands
ARG MAMBA_DOCKERFILE_ACTIVATE=1
# Copy requirements and dependency installation script
COPY docker/requirements/baseimage.txt docker/requirements/core.txt docker/requirements/assemble.txt docker/requirements/assemble-x86.txt docker/requirements/classify.txt docker/requirements/classify-x86.txt docker/requirements/phylo.txt docker/requirements/phylo-x86.txt /tmp/requirements/
COPY docker/install-conda-deps.sh /tmp/
# Install ALL conda dependencies in single resolver call for proper dependency resolution
# All files resolved together; x86-only files skipped on ARM
# Post-install fixups (inline so vulnerable files never appear in a committed layer):
# - mafft's dash_client: Go 1.22.1 binary with Go stdlib CVEs; we never use --dash mode
# - Ruby json gem: mummer4 → yaggo → Ruby, whose bundled json gem has CVE-2026-33210;
# remove the old default gem and install patched version (>=2.19.2)
RUN /tmp/install-conda-deps.sh /tmp/requirements/baseimage.txt /tmp/requirements/core.txt /tmp/requirements/assemble.txt /tmp/requirements/classify.txt /tmp/requirements/phylo.txt \
--x86-only:/tmp/requirements/assemble-x86.txt \
--x86-only:/tmp/requirements/classify-x86.txt \
--x86-only:/tmp/requirements/phylo-x86.txt && \
rm -f /opt/conda/libexec/mafft/dash_client && \
find /opt/conda/lib/ruby -maxdepth 3 -name 'json*' -not -path '*/psych/*' -exec rm -rf {} + && \
rm -f /opt/conda/lib/ruby/gems/*/specifications/default/json-*.gemspec && \
gem install json --version '>=2.19.2' --no-document
# Copy source code (includes all modules)
COPY src/ /opt/viral-ngs/source/src/
COPY pyproject.toml README.md LICENSE /opt/viral-ngs/source/
# Install viral-ngs package
# VERSION is passed from GitHub Actions via git describe
WORKDIR /opt/viral-ngs/source
ARG VERSION
ENV SETUPTOOLS_SCM_PRETEND_VERSION=${VERSION}
RUN pip install --no-cache-dir . && \
echo "${VERSION}" > /opt/viral-ngs/source/VERSION
# Verify installation - all modules
RUN python -c "from viral_ngs import read_utils, illumina; print('Core command modules OK')" && \
python -c "from viral_ngs import assembly; print('Assembly command modules OK')" && \
python -c "from viral_ngs import metagenomics, taxon_filter, kmer_utils; print('Classify command modules OK')" && \
python -c "from viral_ngs import interhost, intrahost, ncbi; print('Phylo command modules OK')" && \
python -c "from viral_ngs.core import samtools, picard, bwa; print('Core tools OK')" && \
python -c "from viral_ngs.assemble import spades, mummer, mafft; print('Assemble tools OK')" && \
python -c "from viral_ngs.classify import kraken2, blast, bmtagger; print('Classify tools OK')" && \
python -c "from viral_ngs.phylo import mafft, muscle, snpeff; print('Phylo tools OK')"
# Clean up
RUN rm -rf /tmp/requirements /tmp/install-conda-deps.sh
CMD ["/bin/bash"]