Created
June 4, 2018 10:25
-
-
Save snakers4/6fab0854f6124494e3d757c97850d4b8 to your computer and use it in GitHub Desktop.
Atmyra Dockerfile
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
# add 7z tar and zip archivers | |
FROM nvidia/cuda:9.0-cudnn7-devel | |
# https://docs.docker.com/engine/examples/running_ssh_service/ | |
RUN apt-get update && apt-get install -y openssh-server | |
RUN mkdir /var/run/sshd | |
RUN echo 'root:Ubuntu@41' | chpasswd | |
RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config | |
RUN sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config | |
RUN mkdir ~/.ssh/ | |
RUN touch ~/.ssh/authorized_keys | |
RUN echo 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDPlILkHRoLnwMS3JlNO94FAYChrW+jGXMxFK5eRmCcBtTJRrV7zyv5mqIBhyJQFiQOqeycttVQP/HTJ9XCwVY0/WK5b45Z6PmfY9PJ5uiLahTCLi8ayoqhDsIWTlWYL03dG7Oz0WEwWQ6BDmSbfS12GEzWQTLqNh7nwsmTXE5503bRtmTre69625gT8c+mgvBOoQfMN1XePxJ14j8h1dVB1Y0geRLJb7yYd4Dl6tnEb3PyGizNVaiVYeBBTx6N/8lvSVA+FYR9mOg3yzYrJ0Aqyj33Oi+jvPqZP16EUhjCukKQWH3IzS1pRvYPCXzPYwvMGvBa00f9GPDccE0eiawH atmyre@Everett' >> ~/.ssh/authorized_keys | |
# SSH login fix. Otherwise user is kicked off after login | |
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd | |
ENV NOTVISIBLE "in users profile" | |
RUN echo "export VISIBLE=now" >> /etc/profile | |
ENV CONDA_DIR /opt/conda | |
ENV PATH $CONDA_DIR/bin:$PATH | |
# writing env variables to /etc/profile as mentioned here https://docs.docker.com/engine/examples/running_ssh_service/#run-a-test_sshd-container | |
RUN echo "export CONDA_DIR=/opt/conda" >> /etc/profile | |
RUN echo "export PATH=$CONDA_DIR/bin:$PATH" >> /etc/profile | |
RUN mkdir -p $CONDA_DIR && \ | |
echo export PATH=$CONDA_DIR/bin:'$PATH' > /etc/profile.d/conda.sh && \ | |
apt-get update && \ | |
apt-get install -y wget git libhdf5-dev g++ graphviz openmpi-bin nano && \ | |
wget --quiet https://repo.continuum.io/miniconda/Miniconda3-4.2.12-Linux-x86_64.sh && \ | |
echo "c59b3dd3cad550ac7596e0d599b91e75d88826db132e4146030ef471bb434e9a *Miniconda3-4.2.12-Linux-x86_64.sh" | sha256sum -c - && \ | |
/bin/bash /Miniconda3-4.2.12-Linux-x86_64.sh -f -b -p $CONDA_DIR && \ | |
ln /usr/lib/x86_64-linux-gnu/libcudnn.so /usr/local/cuda/lib64/libcudnn.so && \ | |
ln /usr/lib/x86_64-linux-gnu/libcudnn.so.7 /usr/local/cuda/lib64/libcudnn.so.7 && \ | |
ln /usr/include/cudnn.h /usr/local/cuda/include/cudnn.h && \ | |
rm Miniconda3-4.2.12-Linux-x86_64.sh | |
ENV NB_USER keras | |
ENV NB_UID 1000 | |
RUN echo "export NB_USER=keras" >> /etc/profile | |
RUN echo "export NB_UID=1000" >> /etc/profile | |
RUN echo "export LD_LIBRARY_PATH=/usr/local/cuda/lib64:/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH" >> /etc/profile | |
RUN echo "export CPATH=/usr/include:/usr/include/x86_64-linux-gnu:/usr/local/cuda/include:$CPATH" >> /etc/profile | |
RUN echo "export LIBRARY_PATH=/usr/local/cuda/lib64:/lib/x86_64-linux-gnu:$LIBRARY_PATH" >> /etc/profile | |
RUN echo "export CUDA_HOME=/usr/local/cuda" >> /etc/profile | |
RUN echo "export CPLUS_INCLUDE_PATH=$CPATH" >> /etc/profile | |
RUN echo "export KERAS_BACKEND=tensorflow" >> /etc/profile | |
RUN useradd -m -s /bin/bash -N -u $NB_UID $NB_USER && \ | |
mkdir -p $CONDA_DIR && \ | |
chown keras $CONDA_DIR -R | |
USER keras | |
RUN mkdir -p /home/keras/notebook | |
# Python | |
ARG python_version=3.5 | |
RUN conda install -y python=${python_version} && \ | |
pip install --upgrade pip && \ | |
pip install tensorflow-gpu && \ | |
conda install Pillow scikit-learn notebook pandas matplotlib mkl nose pyyaml six h5py && \ | |
conda install theano pygpu bcolz && \ | |
pip install keras kaggle-cli lxml opencv-python requests scipy tqdm visdom && \ | |
conda install pytorch=0.3.0 cuda90 -c pytorch && \ | |
pip install imgaug && \ | |
conda clean -yt | |
RUN pip install git+https://github.com/ipython-contrib/jupyter_contrib_nbextensions && \ | |
jupyter contrib nbextension install --user | |
ENV LD_LIBRARY_PATH /usr/local/cuda/lib64:/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH | |
ENV CPATH /usr/include:/usr/include/x86_64-linux-gnu:/usr/local/cuda/include:$CPATH | |
ENV LIBRARY_PATH /usr/local/cuda/lib64:/lib/x86_64-linux-gnu:$LIBRARY_PATH | |
ENV CUDA_HOME /usr/local/cuda | |
ENV CPLUS_INCLUDE_PATH $CPATH | |
ENV KERAS_BACKEND tensorflow | |
WORKDIR /home/keras/notebook | |
EXPOSE 8888 6006 22 8097 | |
CMD jupyter notebook --port=8888 --ip=0.0.0.0 --no-browser |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment