Created
July 8, 2019 13:56
-
-
Save tmbdev/f22137260250f430213ff5a3ab9b3327 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM nvidia/cuda:10.0-cudnn7-devel-ubuntu18.04 | |
| ENV LC_ALL=C | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| # Basic Packages | |
| RUN apt-get -qqy update | |
| RUN apt-get install -qqy git curl dtrx buffer mbuffer pv daemon expect mercurial | |
| RUN apt-get install -qqy python3-scipy python3-matplotlib python3-pip python3-h5py graphviz | |
| RUN apt-get install -qqy python-skimage python-sklearn python-pil python-imageio | |
| RUN apt-get install -qqy nodejs npm | |
| # Python3 PIP Packages | |
| RUN pip3 install pipenv virtualenv | |
| RUN pip3 install six future msgpack pyzmq simplejson braceexpand | |
| RUN pip3 install --no-cache-dir --upgrade natsort | |
| RUN pip3 install ipython jupyter bash_kernel sos sos-notebook sos-python sos-bash pydot | |
| RUN pip3 install --no-cache-dir --upgrade git+git://github.com/jupyterlab/jupyterlab.git#egg=jupyterlab | |
| RUN python3 -m bash_kernel.install | |
| RUN python3 -m sos_notebook.install | |
| RUN jupyter labextension install transient-display-data | |
| RUN jupyter labextension install jupyterlab-sos | |
| # Google Cloud | |
| ENV T=google-cloud-sdk-217.0.0-linux-x86_64.tar.gz | |
| ENV PATH=$PATH:/usr/local/google-cloud-sdk/bin | |
| RUN curl https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/$T -o /tmp/$T && \ | |
| rm -rf /usr/local/google-cloud-sdk && \ | |
| mkdir /usr/local/google-cloud-sdk && \ | |
| tar -C /usr/local -zxf /tmp/$T google-cloud-sdk && \ | |
| /usr/local/google-cloud-sdk/install.sh -q --path-update true && \ | |
| gcloud components update && \ | |
| gcloud components install gsutil && \ | |
| rm -rf /tmp/$T | |
| # PyTorch | |
| RUN pip3 install torch -f https://download.pytorch.org/whl/cu100/stable | |
| RUN pip3 install torchvision | |
| # OpenCV | |
| RUN apt-get install -qqy libopencv-dev libopencv-*-dev opencv-data | |
| RUN apt-get install -qqy python3-opencv | |
| RUN apt-get install -qqy imagemagick graphicsmagick | |
| # GitHub Packages | |
| RUN pip3 install --no-cache-dir --upgrade git+git://github.com/tmbdev/hocr-tools | |
| RUN pip3 install --no-cache-dir --upgrade git+git://github.com/NVlabs/webloader | |
| RUN pip3 install --no-cache-dir --upgrade git+git://github.com/NVlabs/torchtrainers | |
| # Optional Local Packages | |
| RUN test -d /proj/tensorcom && pip3 install --no-cache-dir --upgrade /proj/tensorcom | |
| RUN test -d /proj/torchmore && pip3 install --no-cache-dir --upgrade /proj/torchmore | |
| # APEX/AMP | |
| #RUN cd /tmp && git clone https://github.com/NVIDIA/apex && cd apex && pip3 install -v --no-cache-dir --global-option="--cpp-ext" --global-option="--cuda_ext" ./ && rm -rf /tmp/apex | |
| #:# Run with a script like this: | |
| #:# | |
| #:# #!/bin/bash | |
| #:# | |
| #:# docker run \ | |
| #:# --runtime=nvidia \ | |
| #:# --network host \ | |
| #:# -v /etc/passwd:/etc/passwd \ | |
| #:# -v /etc/group:/etc/group \ | |
| #:# -v $HOME:$HOME \ | |
| #:# -v `pwd`:`pwd` \ | |
| #:# -w `pwd` \ | |
| #:# -u $(id -u):$(id -g) \ | |
| #:# -i \ | |
| #:# -t pt3 \ | |
| #:# "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment