-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
53 lines (37 loc) · 1.65 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#FROM python:3.6
FROM nvidia/cuda:9.0-base-ubuntu16.04
SHELL ["/bin/bash", "--login", "-c"]
RUN apt-get update && apt-get install -y \
vim locales cmake make gcc libgl1-mesa-glx \
wget bzip2 curl git python-pip && rm -rf /var/lib/apt/lists/*
RUN apt-get update
RUN apt install -y libsm6 libxext6
RUN apt-get install -y libxrender-dev
# Install miniconda3
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \
/bin/bash ~/miniconda.sh -b -p /opt/conda && \
rm ~/miniconda.sh && \
/opt/conda/bin/conda clean -tipsy && \
ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh
# Set default base directory for subsequent steps
WORKDIR /opt
# Install python dependencies before handling application files.
# COPY of a directory appears to disrupt layer cacheing.
COPY conda.env conda.env
# source conda scripts by default
RUN echo '. /opt/conda/etc/profile.d/conda.sh' >> ~/.bashrc
# Install conda packages
RUN conda env create -f conda.env && rm -rf /opt/conda/pkgs/*
# Activate works by default
RUN echo "conda activate donkey" >> ~/.bashrc
COPY requirements.txt /opt/requirements.txt
RUN conda activate donkey && pip install -r /opt/requirements.txt
RUN conda activate donkey && jupyter notebook --generate-config
RUN echo "c.NotebookApp.password = ''">>/root/.jupyter/jupyter_notebook_config.py
RUN echo "c.NotebookApp.token = ''">>/root/.jupyter/jupyter_notebook_config.py
#start the jupyter notebook
CMD conda activate donkey && jupyter notebook --no-browser --ip 0.0.0.0 --port 8888 --allow-root --notebook-dir=/notebooks/
#for donkeycar
EXPOSE 8887
#for jupyter notebook
EXPOSE 8888