Skip to content

Commit

Permalink
docker: Use conda to install dependencies; add conda environment
Browse files Browse the repository at this point in the history
This results in both a shorter Dockerfile and a smaller final image.
The conda environment matches the existing conda packaging in devtools/.
  • Loading branch information
etal committed Apr 11, 2024
1 parent df9aa07 commit 537491d
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 13 deletions.
29 changes: 29 additions & 0 deletions conda-env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Usage:
# conda env create -f conda-env.yaml
# or:
# conda env update -v -n [base] -f conda-env.yml [--prune]
# This does not install CNVkit itself. Use pip to install either a stable release from
# PyPI (pip install cnvkit), or this local repo (pip install -e .).
name: cnvkit
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- python>=3.8
- atlas # [not osx]
- bioconductor-dnacopy
- biopython >=1.80
- matplotlib >=3.5.2
- numpy >=1.24.2
- pandas >=1.5.3
- pomegranate >=0.14.8, <=0.14.9
- pyfaidx >=0.7.1
- pysam >=0.20.0
- pytest
- reportlab >=3.6.12
- ruff
- scikit-learn >=1.1.0
- scipy >=1.10.1
- tox

19 changes: 6 additions & 13 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
FROM ubuntu:rolling
FROM continuumio/miniconda3:23.10.0-1
MAINTAINER Eric Talevich <me+code@etal.mozmail.com>

ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y \
liblzma-dev \
python3-dev \
python3-pip \
r-bioc-dnacopy \
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*

RUN pip3 install --upgrade pip --break-system-packages && \
pip3 install cnvkit==0.9.10 --break-system-packages && \
pip3 cache purge
# Install directly into 'base' conda environment
COPY conda-env.yml ./conda-env.yml
RUN conda env update -v -n base -f conda-env.yml
RUN conda clean --all --verbose
RUN pip3 install cnvkit==0.9.10 --no-cache
# Let matplotlib build its font cache
RUN cnvkit.py version

Expand Down

0 comments on commit 537491d

Please sign in to comment.