From 537491d0fe8c33681067e8c6a976d73c03297c95 Mon Sep 17 00:00:00 2001 From: Eric Talevich Date: Thu, 11 Apr 2024 14:14:57 -0700 Subject: [PATCH] docker: Use conda to install dependencies; add conda environment This results in both a shorter Dockerfile and a smaller final image. The conda environment matches the existing conda packaging in devtools/. --- conda-env.yml | 29 +++++++++++++++++++++++++++++ docker/Dockerfile | 19 ++++++------------- 2 files changed, 35 insertions(+), 13 deletions(-) create mode 100644 conda-env.yml diff --git a/conda-env.yml b/conda-env.yml new file mode 100644 index 00000000..edd3998a --- /dev/null +++ b/conda-env.yml @@ -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 + diff --git a/docker/Dockerfile b/docker/Dockerfile index 474d6ed1..c82f55db 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,18 +1,11 @@ -FROM ubuntu:rolling +FROM continuumio/miniconda3:23.10.0-1 MAINTAINER Eric Talevich -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