Skip to content

Dockerfile #26

Description

@jesgj

With this Dockerfile I have installed edd. You first have to use git clone and run the Dockerfile inside the directory . I had some problems running it maybe it was my sample. Anyways give it a try.

Step 1: Use an older, stable base image with Python 2.7 support.

FROM ubuntu:18.04

Step 2: Set environment variables to prevent interactive prompts.

ENV DEBIAN_FRONTEND=noninteractive

Step 3: Install all necessary system-level dependencies.

RUN apt-get update &&
apt-get install -y --no-install-recommends
python2.7
python2.7-dev
python-pip
bedtools
build-essential
gfortran
liblapack-dev
libblas-dev
zlib1g-dev &&
apt-get clean &&
rm -rf /var/lib/apt/lists/*

Step 4: Make python2.7 the default python executable.

RUN update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1

Step 5: Create a stable Python 2.7 packaging environment by pinning versions.

RUN python -m pip install "pip==20.3.4" "setuptools==44.1.1" "wheel==0.37.1"

Step 6: Install the EDD Python package dependencies with pinned versions.

RUN python -m pip install
"Cython==0.29.36"
"numpy==1.16.6"
"pysam==0.11.2.2"
"Logbook==1.4.1"
"pybedtools==0.8.2"
"statsmodels==0.9.0"
"patsy"
"pandas==0.24.2"
"python-dateutil"
"scipy"

Step 7: Set the working directory and copy the application source code.

WORKDIR /app
COPY . .

Step 8: Patch the broken setup.py file to fix the build-time linking.

RUN python -c "import os, re, pysam; pysam_path = os.path.dirname(pysam.file); f_in = open('setup.py').read(); f_out = re.sub(r"(define_macros=pysam.get_defines\(\),)", r"\1 library_dirs=[r'" + pysam_path + r"'], libraries=['chtslib'],", f_in); open('setup.py', 'w').write(f_out)"

Step 9: Install the now-patched edd tool using pip.

RUN pip install .

Step 10: ** SET THE RUNTIME LIBRARY PATH (DEFINITIVE FIX) **

This tells the operating system's linker where to find the pysam libraries

(like libchtslib.so) when the edd command is executed.

ENV LD_LIBRARY_PATH /usr/local/lib/python2.7/dist-packages/pysam

Step 11: Set the final working directory for running analyses.

WORKDIR /data

Step 12: Set the entrypoint to make the container behave like the edd command.

ENTRYPOINT ["edd"]

Step 13: Set a default command to show the help message.

CMD ["-h"]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions