28 lines
1.0 KiB
Docker
28 lines
1.0 KiB
Docker
FROM python:3-alpine
|
|
|
|
LABEL maintainer="<author>"
|
|
LABEL version="selfbuilt"
|
|
|
|
WORKDIR /jupyter
|
|
RUN \
|
|
sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories &&\
|
|
apk add --no-cache libc-dev libffi-dev gcc && \
|
|
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple jupyter --no-cache-dir && \
|
|
apk del libc-dev libffi-dev gcc &&\
|
|
addgroup notebook &&\
|
|
adduser -Ss /bin/nologin -g notebook notebook &&\
|
|
chown -R notebook:notebook . &&\
|
|
mkdir /data &&\
|
|
chown -R notebook:notebook /data
|
|
RUN \
|
|
jupyter notebook --generate-config &&\
|
|
mkdir ./config &&\
|
|
cp /root/.jupyter/jupyter_notebook_config.py ./config
|
|
|
|
RUN \
|
|
sed -i.bak 's/# c.NotebookApp.ip = .*/c.NotebookApp.ip = '\''0.0.0.0'\''/' ~/.jupyter/jupyter_notebook_config.py && \
|
|
sed -i.bak 's/# c.NotebookApp.notebook_dir = .*/c.NotebookApp.notebook_dir = '\''\/data'\''/' ~/.jupyter/jupyter_notebook_config.py
|
|
|
|
EXPOSE 8888
|
|
USER notebook
|
|
CMD [ "jupyter", "notebook", "--config=", "\"/jupyter/config\"" ] |