2023-10-23 07:11:16 +08:00

23 lines
785 B
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 sudo && \
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple jupyterlab --no-cache-dir && \
apk del libc-dev libffi-dev gcc
RUN \
addgroup notebook &&\
adduser -Ss /bin/bash -g notebook notebook &&\
echo "notebook ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
echo "notebook:123456" | chpasswd &&\
chown -R notebook:notebook . &&\
mkdir /data &&\
chown -R notebook:notebook /data
EXPOSE 8888
USER notebook
CMD ["jupyter", "lab", "--no-browser", "--ip", "\"0.0.0.0\"", "--port", "8888", "--allow-root"]