Dockerfile 774 B

1234567891011121314151617181920
  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 && \
  8. pip install -i https://pypi.tuna.tsinghua.edu.cn/simple jupyter --no-cache-dir && \
  9. apk del libc-dev libffi-dev gcc
  10. RUN \
  11. jupyter notebook --generate-config &&\
  12. mkdir /data &&\
  13. sed -i.bak 's/# c.NotebookApp.ip = .*/c.NotebookApp.ip = '\''0.0.0.0'\''/' /root/.jupyter/jupyter_notebook_config.py && \
  14. sed -i.bak 's/# c.NotebookApp.notebook_dir = .*/c.NotebookApp.notebook_dir = '\''\/data'\''/' /root/.jupyter/jupyter_notebook_config.py
  15. EXPOSE 8888
  16. USER root
  17. CMD [ "jupyter", "notebook", "--allow-root" ]