Skip to content

Instantly share code, notes, and snippets.

@oeway
Created May 23, 2019 12:02
Show Gist options
  • Save oeway/8c35f731392c947234c34c5ef7cd8d6d to your computer and use it in GitHub Desktop.
Save oeway/8c35f731392c947234c34c5ef7cd8d6d to your computer and use it in GitHub Desktop.
The docker file for running ImJoy Engine on Kubernetes cluster
FROM nvcr.io/nvidia/cuda:9.0-cudnn7-devel-ubuntu16.04
# System packages
RUN apt-get update && apt-get install -y \
bzip2 \
bc \
build-essential \
cmake \
curl \
g++ \
gfortran \
git \
libffi-dev \
libfreetype6-dev \
libhdf5-dev \
libjpeg-dev \
liblcms2-dev \
libopenblas-dev \
liblapack-dev \
libpng12-dev \
libssl-dev \
libtiff5-dev \
libwebp-dev \
libzmq3-dev \
libsm6 \
libxext6 \
libxrender-dev \
pkg-config \
software-properties-common \
unzip \
wget \
&& \
apt-get clean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/* && \
# Link BLAS library to use OpenBLAS using the alternatives mechanism (https://www.scipy.org/scipylib/building/linux.html#debian-ubuntu)
update-alternatives --set libblas.so.3 /usr/lib/openblas-base/libblas.so.3
RUN addgroup --gid 1001 python && \
useradd --uid 1001 --gid 1001 python
RUN mkdir /imjoy-engine /home/python
WORKDIR /imjoy-engine
# Install miniconda to /miniconda
RUN curl -LO https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
RUN bash Miniconda3-latest-Linux-x86_64.sh -p /imjoy-engine/miniconda -b
RUN rm Miniconda3-latest-Linux-x86_64.sh
ENV PATH=/imjoy-engine/miniconda/bin:${PATH}
RUN conda update -y conda
COPY docker-entrypoint.sh /imjoy-engine/docker-entrypoint
RUN ["chmod", "+x", "/imjoy-engine/docker-entrypoint"]
# Python packages from conda
RUN conda update -y conda && \
conda update -y pip && \
conda install -y python=3.6 numpy scipy git psutil && \
pip install scikit-image Pillow && \
pip install git+https://github.com/oeway/ImJoy-Engine#egg=imjoy
RUN chown 1001:1001 -R /imjoy-engine /home/python
EXPOSE 8080
USER 1001
ENTRYPOINT ["/imjoy-engine/docker-entrypoint"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment