|
| 1 | +# syntax=docker/dockerfile:1 |
| 2 | + |
| 3 | +FROM ubuntu:20.04 |
| 4 | +# LABEL about the custom image |
| 5 | +LABEL maintainer= "[email protected]" |
| 6 | +LABEL description="This is custom Docker Image for running PathML" |
| 7 | + |
| 8 | +# Disable Prompt During Packages Installation |
| 9 | +ARG DEBIAN_FRONTEND=noninteractive |
| 10 | + |
| 11 | +#Set miniconda path |
| 12 | +ENV PATH="/root/miniconda3/bin:${PATH}" |
| 13 | +ARG PATH="/root/miniconda3/bin:${PATH}" |
| 14 | + |
| 15 | +ENV JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/jre/" |
| 16 | +ARG JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/jre/" |
| 17 | + |
| 18 | +ENV SHELL="/bin/bash" |
| 19 | + |
| 20 | +#install packages on root |
| 21 | +USER root |
| 22 | + |
| 23 | +#download and install miniconda and external dependencies |
| 24 | +RUN apt-get update && apt-get install -y --no-install-recommends openslide-tools \ |
| 25 | + g++ \ |
| 26 | + gcc \ |
| 27 | + libpixman-1-0 \ |
| 28 | + libblas-dev \ |
| 29 | + liblapack-dev \ |
| 30 | + wget \ |
| 31 | + openjdk-8-jre \ |
| 32 | + openjdk-8-jdk \ |
| 33 | + && wget \ |
| 34 | + https://repo.anaconda.com/miniconda/Miniconda3-py38_4.10.3-Linux-x86_64.sh \ |
| 35 | + && mkdir /root/.conda \ |
| 36 | + && bash Miniconda3-py38_4.10.3-Linux-x86_64.sh -b \ |
| 37 | + && rm -f Miniconda3-py38_4.10.3-Linux-x86_64.sh \ |
| 38 | + && rm -rf /var/lib/apt/lists/* |
| 39 | + |
| 40 | +# copy pathml files into docker |
| 41 | +COPY setup.py README.md /opt/pathml/ |
| 42 | +COPY pathml/ /opt/pathml/pathml |
| 43 | +COPY tests/ /opt/pathml/tests |
| 44 | + |
| 45 | +# install pathml and deepcell |
| 46 | +RUN pip3 install --upgrade pip \ |
| 47 | + && pip3 install numpy==1.19.5 \ |
| 48 | + && pip3 install python-bioformats==4.0.0 deepcell /opt/pathml/ pytest |
| 49 | + |
| 50 | +# run tests to verify container |
| 51 | +WORKDIR /opt/pathml |
| 52 | +RUN python3 -m pytest /opt/pathml/tests/ -m "not slow" |
| 53 | + |
| 54 | +WORKDIR /home/pathml |
| 55 | + |
| 56 | +# set up jupyter lab |
| 57 | +RUN pip3 install jupyter -U && pip3 install jupyterlab |
| 58 | +EXPOSE 8888 |
| 59 | +ENTRYPOINT ["jupyter", "lab", "--ip=0.0.0.0", "--allow-root", "--no-browser"] |
0 commit comments