Run as unprivileged user, Python 3 support

This commit is contained in:
Bradlee Speice 2016-10-14 13:42:40 -04:00
parent dcadc632a6
commit dbff37ed47
2 changed files with 14 additions and 1 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.swp

View File

@ -1,7 +1,7 @@
FROM nvidia/cuda:8.0-cudnn5-devel-ubuntu16.04 FROM nvidia/cuda:8.0-cudnn5-devel-ubuntu16.04
MAINTAINER Bradlee Speice MAINTAINER Bradlee Speice
LABEL Description="Jupyter server setup for ECBM E4040 Neural Networks" Version="0.2" LABEL Description="Jupyter server setup for ECBM E4040 Neural Networks" Version="0.3"
# Update our cache first # Update our cache first
RUN apt-get update && \ RUN apt-get update && \
@ -13,16 +13,28 @@ RUN apt-get update && \
apt-get install -y \ apt-get install -y \
python3 libpython3-dev \ python3 libpython3-dev \
python-pandas python-matplotlib python-sklearn \ python-pandas python-matplotlib python-sklearn \
python3-pandas python3-matplotlib python3-sklearn \
texlive-latex-extra texlive-fonts-recommended texlive-generic-recommended pandoc texlive-latex-extra texlive-fonts-recommended texlive-generic-recommended pandoc
# And the python-specific tools # And the python-specific tools
RUN pip install theano jupyter RUN pip install theano jupyter
# And the python3-specific tools
RUN pip3 install theano jupyter
# And the startup script # And the startup script
COPY . / COPY . /
# Set up Theano for the GPU # Set up Theano for the GPU
ENV THEANO_FLAGS='floatX=float32,device=gpu' ENV THEANO_FLAGS='floatX=float32,device=gpu'
# Set up an unprivileged user to run as
RUN useradd jupyter -s /bin/false && \
mkdir /home/jupyter && \
chown jupyter:jupyter /home/jupyter && \
passwd jupyter -l
ENTRYPOINT ["/sbin/runuser", "-u", "jupyter", "/usr/local/bin/start_jupyter"]
EXPOSE 8888 EXPOSE 8888