2023-06-29 19:48:21 +08:00
|
|
|
FROM nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04
|
2023-03-13 21:20:02 +08:00
|
|
|
|
|
|
|
# encoding
|
|
|
|
RUN echo "LC_ALL=en_US.UTF-8" >> /etc/environment
|
|
|
|
RUN echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
|
|
|
|
RUN echo "LANG=en_US.UTF-8" > /etc/locale.conf
|
|
|
|
|
|
|
|
|
|
|
|
# fix (tzdata)
|
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
2023-06-29 19:48:21 +08:00
|
|
|
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub
|
|
|
|
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub
|
2023-03-13 21:20:02 +08:00
|
|
|
RUN apt-get -y update && \
|
|
|
|
apt-get -y upgrade && \
|
2023-05-04 18:35:20 +08:00
|
|
|
apt-get install -y python3.8 python3-pip
|
2023-06-29 16:38:12 +08:00
|
|
|
ENV PYTHON_VERSION=3.8
|
2023-03-13 21:20:02 +08:00
|
|
|
|
|
|
|
RUN apt-get install -y locales git vim nano
|
|
|
|
|
|
|
|
RUN apt-get install -y zsh && apt-get install -y curl
|
2023-05-04 18:35:20 +08:00
|
|
|
ENV PATH="$PATH:/usr/bin/zsh"
|
|
|
|
ENV PATH=/usr/bin:$PATH
|
2023-03-13 21:20:02 +08:00
|
|
|
RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RUN echo 'alias python="python3"' >> ~/.bashrc
|
|
|
|
RUN echo 'alias python="python3"' >> ~/.zshrc
|
|
|
|
RUN echo 'alias pip="pip3"' >> ~/.bashrc
|
|
|
|
RUN echo 'alias pip="pip3"' >> ~/.zshrc
|
|
|
|
|
|
|
|
|
|
|
|
RUN apt-get install -y openssh-server
|
|
|
|
RUN mkdir /var/run/sshd
|
|
|
|
RUN echo 'root:qwerty' | chpasswd
|
|
|
|
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
|
|
|
|
RUN sed -i 's/#PubkeyAuthentication yes/PubkeyAuthentication yes/' /etc/ssh/sshd_config
|
|
|
|
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
|
|
|
|
EXPOSE 22
|
|
|
|
|
|
|
|
RUN usermod -s /bin/zsh root
|
|
|
|
|
2023-08-11 23:08:44 +08:00
|
|
|
ENTRYPOINT service ssh start && bash
|