# debian.sh --arch 'amd64' out/ 'bookworm' '@1740355200' |
ARG PYPI_MIRROR=https://mirrors.ustc.edu.cn/pypi/simple |
ARG DEBIAN_MIRROR=mirrors.ustc.edu.cn |
EXPOSE map[8888/tcp:{}] |
USER root |
ENV DEBIAN_FRONTEND=noninteractive NB_USER=jovyan NB_UID=1000 NB_GID=100 SHELL=/bin/bash PATH=/opt/base/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin HOME=/home/jovyan |
COPY start-sh/* /usr/local/bin/ # buildkit |
COPY jupyter_server_config.py docker_healthcheck.py /etc/jupyter/ # buildkit |
COPY profile /etc/ # buildkit |
RUN |2 PYPI_MIRROR=https://mirrors.ustc.edu.cn/pypi/simple DEBIAN_MIRROR=mirrors.ustc.edu.cn /bin/sh -c sed -i "s/deb.debian.org/${DEBIAN_MIRROR}/g" /etc/apt/sources.list.d/debian.sources && apt-get update --yes && apt-get install --yes --no-install-recommends sudo tini unzip python3-venv && apt-get clean && rm -rf /var/lib/apt/lists/* && chmod a+rx /usr/local/bin/* /etc/jupyter/docker_healthcheck.py && echo "auth requisite pam_deny.so" >> /etc/pam.d/su && sed -i.bak -e 's/^%admin/#%admin/' /etc/sudoers && sed -i.bak -e 's/^%sudo/#%sudo/' /etc/sudoers && useradd --no-log-init --create-home --shell /bin/bash --uid "${NB_UID}" --no-user-group "${NB_USER}" && echo "${NB_USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers && chmod g+w /etc/passwd && mkdir /usr/local/bin/start-notebook.d && mkdir /usr/local/bin/before-notebook.d && mkdir -p "/opt/base/" && python3 -m venv /opt/base && chown -hR "${NB_USER}:${NB_GID}" "/opt/base" && echo "[global]\nindex-url = ${PYPI_MIRROR}" > /etc/pip.conf # buildkit |
HEALTHCHECK &{["CMD-SHELL" "/etc/jupyter/docker_healthcheck.py || exit 1"] "3s" "1s" "3s" "0s" '\x03'} |
USER 1000 |
RUN |2 PYPI_MIRROR=https://mirrors.ustc.edu.cn/pypi/simple DEBIAN_MIRROR=mirrors.ustc.edu.cn /bin/sh -c pip install 'jupyterlab' 'jupyterhub' && pip install jupyterlab-language-pack-zh-CN jupyterlab-lsp jupyterlab-execute-time jedi-language-server && pip cache purge # buildkit |
WORKDIR /home/jovyan |
ENTRYPOINT ["tini" "-g" "--" "start.sh"] |
CMD ["start-notebook.py"] |
RUN /bin/sh -c pip install duckdb duckdb_kernel && pip cache purge # buildkit |