Dockerfile 743 B

123456789101112131415161718
  1. FROM ubuntu:22.04
  2. RUN cp /etc/apt/sources.list /etc/apt/sources.list.ori && \
  3. sed -i s@/archive.ubuntu.com/@/mirrors.ustc.edu.cn/@g /etc/apt/sources.list && \
  4. sed -i s@/security.ubuntu.com/@/mirrors.ustc.edu.cn/@g /etc/apt/sources.list && \
  5. apt clean &&\
  6. mkdir /jupyter &&\
  7. groupadd notebook &&\
  8. useradd -m -s /bin/bash -G notebook notebooks &&\
  9. usermod -aG sudo notebooks &&\
  10. echo 'notebooks:123456' | chpasswd &&\
  11. chown -R notebooks:notebook /jupyter
  12. RUN apt update && apt install -y python3 python3-pip sudo
  13. RUN pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple jupyterlab
  14. EXPOSE 8888
  15. USER notebooks
  16. CMD ["jupyter", "lab", "--no-browser", "--ip", "\"0.0.0.0\"", "--port", "8888", "--allow-root"]