Dockerfile 785 B

1234567891011121314151617181920212223
  1. FROM python:3-alpine
  2. LABEL maintainer="<author>"
  3. LABEL version="selfbuilt"
  4. WORKDIR /jupyter
  5. RUN \
  6. sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories &&\
  7. apk add --no-cache libc-dev libffi-dev gcc sudo && \
  8. pip install -i https://pypi.tuna.tsinghua.edu.cn/simple jupyterlab --no-cache-dir && \
  9. apk del libc-dev libffi-dev gcc
  10. RUN \
  11. addgroup notebook &&\
  12. adduser -Ss /bin/bash -g notebook notebook &&\
  13. echo "notebook ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
  14. echo "notebook:123456" | chpasswd &&\
  15. chown -R notebook:notebook . &&\
  16. mkdir /data &&\
  17. chown -R notebook:notebook /data
  18. EXPOSE 8888
  19. USER notebook
  20. CMD ["jupyter", "lab", "--no-browser", "--ip", "\"0.0.0.0\"", "--port", "8888", "--allow-root"]