FROM nvidia/cuda:12.0.0-cudnn8-devel-ubuntu22.04
COPY  sources.list.20.04 /etc/apt/sources.list
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
                vim \
                curl \
                git \
                unzip \
                zip \
                wget \
                openssh-server iputils-ping locales tzdata \
                && sed -i "s/.*PermitRootLogin.*/PermitRootLogin yes/g" /etc/ssh/sshd_config
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install curl apt-utils  tzdata software-properties-common   && rm -rf /var/lib/apt/lists/*

RUN  add-apt-repository -y ppa:deadsnakes/ppa &&   apt-get update && apt-get install -y python3.10 python3.10-dev  python3.10-distutil  && curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10                                 && apt-get clean && ln -sf /usr/bin/python3.10 /usr/bin/python && ln -fs /usr/bin/pip3 /usr/bin/pip                                  && rm -rf /var/lib/apt/lists/*
RUN  pip install traitlets==5.9.0 jupyter_server notebook==6.4.10  --no-cache-dir -i https://pypi.tuna.tsinghua.edu.cn/simple  -U pip
#RUN pip install traitlets==5.9.0 jupyter_server  -i https://pypi.tuna.tsinghua.edu.cn/simple
RUN mkdir -p /etc/jupyter /ai
COPY jupyter_notebook_config.py /etc/jupyter/
COPY run.sh /usr/local/bin/
COPY notebook /usr/local/bin/
RUN chmod +x /usr/local/bin/run.sh && chmod +x /usr/local/bin/notebook 
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
EXPOSE 22
ENV SHELL=/bin/bash
EXPOSE 8888
ENV LANG=C.UTF-8
CMD ["run.sh"]
        
