forked from tianzhi0549/FCOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dockerfile with jupyter notebook support (tianzhi0549#202)
* Dockerfile with jupyter notebook support * add instruction of building docker with jupyter * upload dockerfile with jupyter support * remove Dockerfile-jupyter * remove jupyter_notebook_config.py * update INSTALL.md * Dockerfile with jupyter notebook support * add instruction of building docker with jupyter * upload dockerfile with jupyter support * remove Dockerfile-jupyter * remove jupyter_notebook_config.py * update INSTALL.md * apply changes in 1123 * update INSTALL.md * update install.md add description of the password add -v flag * clean up * remove tensorflow copyright
- Loading branch information
1 parent
bc625c1
commit bcb3212
Showing
3 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
ARG CUDA="9.0" | ||
ARG CUDNN="7" | ||
|
||
FROM nvidia/cuda:${CUDA}-cudnn${CUDNN}-devel-ubuntu16.04 | ||
|
||
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections | ||
|
||
# install basics | ||
RUN apt-get update -y \ | ||
&& apt-get install -y apt-utils git curl ca-certificates bzip2 cmake tree htop bmon iotop g++ | ||
|
||
# Install Miniconda | ||
RUN curl -so /miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \ | ||
&& chmod +x /miniconda.sh \ | ||
&& /miniconda.sh -b -p /miniconda \ | ||
&& rm /miniconda.sh | ||
|
||
ENV PATH=/miniconda/bin:$PATH | ||
|
||
# Create a Python 3.6 environment | ||
RUN /miniconda/bin/conda install -y conda-build \ | ||
&& /miniconda/bin/conda create -y --name py36 python=3.6.7 \ | ||
&& /miniconda/bin/conda clean -ya | ||
|
||
ENV CONDA_DEFAULT_ENV=py36 | ||
ENV CONDA_PREFIX=/miniconda/envs/$CONDA_DEFAULT_ENV | ||
ENV PATH=$CONDA_PREFIX/bin:$PATH | ||
ENV CONDA_AUTO_UPDATE_CONDA=false | ||
|
||
RUN conda install -y ipython | ||
RUN pip install ninja yacs cython matplotlib jupyter | ||
|
||
# Install PyTorch 1.0 Nightly and OpenCV | ||
RUN conda install -y pytorch-nightly -c pytorch \ | ||
&& conda install -y opencv -c menpo \ | ||
&& conda clean -ya | ||
|
||
WORKDIR /root | ||
|
||
USER root | ||
|
||
RUN mkdir /notebooks | ||
|
||
WORKDIR /notebooks | ||
|
||
# Install TorchVision master | ||
RUN git clone https://github.com/pytorch/vision.git \ | ||
&& cd vision \ | ||
&& python setup.py install | ||
|
||
# install pycocotools | ||
RUN git clone https://github.com/cocodataset/cocoapi.git \ | ||
&& cd cocoapi/PythonAPI \ | ||
&& python setup.py build_ext install | ||
|
||
# install PyTorch Detection | ||
RUN git clone https://github.com/facebookresearch/maskrcnn-benchmark.git \ | ||
&& cd maskrcnn-benchmark \ | ||
&& python setup.py build develop | ||
|
||
RUN jupyter notebook --generate-config | ||
|
||
ENV CONFIG_PATH="/root/.jupyter/jupyter_notebook_config.py" | ||
|
||
COPY "jupyter_notebook_config.py" ${CONFIG_PATH} | ||
|
||
ENTRYPOINT ["sh", "-c", "jupyter notebook --allow-root -y --no-browser --ip=0.0.0.0 --config=${CONFIG_PATH}"] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import os | ||
from IPython.lib import passwd | ||
|
||
#c = c # pylint:disable=undefined-variable | ||
c = get_config() | ||
c.NotebookApp.ip = '0.0.0.0' | ||
c.NotebookApp.port = int(os.getenv('PORT', 8888)) | ||
c.NotebookApp.open_browser = False | ||
|
||
# sets a password if PASSWORD is set in the environment | ||
if 'PASSWORD' in os.environ: | ||
password = os.environ['PASSWORD'] | ||
if password: | ||
c.NotebookApp.password = passwd(password) | ||
else: | ||
c.NotebookApp.password = '' | ||
c.NotebookApp.token = '' | ||
del os.environ['PASSWORD'] |