Not sure is this a bug of jupyter notebook or a bug of nbextensions.
To Reproduce
Steps to reproduce the behavior:
the content of Dockerfile
# syntax=docker/dockerfile:experimental
FROM python:3.8-buster@sha256:6a25504ef508896ab6682c1696b53ea7a5247b45ca1466e708717ce675831c03
RUN sed -i "s/\\w\+.debian.org/mirrors.aliyun.com/g" /etc/apt/sources.list \
&& pip install -U pip -i https://mirrors.aliyun.com/pypi/simple \
&& pip config set global.index-url https://mirrors.aliyun.com/pypi/simple
RUN --mount=type=cache,target=/var/cache/apt \
--mount=type=cache,target=/var/lib/apt \
apt-get update \
&& apt-get install -yq --no-install-recommends \
ca-certificates \
libgeos-dev \
wget \
nodejs \
npm \
g++ \
libzmq3-dev \
gosu \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
RUN --mount=type=cache,target=/root/.cache/pip \
pip install \
jupyter==1.0.0 \
jupyter_contrib_nbextensions \
&& jupyter contrib nbextension install --system
VOLUME [ "/workspace" ]
WORKDIR /workspace
COPY entrypoint.sh /usr/local/bin/
ENV NB_USER=jupyter NB_GROUP=jupyter NB_UID=1000 NB_GID=1000 NB_HOME=/workspace
ENTRYPOINT [ "entrypoint.sh" ]
CMD [ "jupyter", "notebook", "--ip=0.0.0.0"]
the content of entrypoint.sh:
#!/bin/bash
set -e
# Add group
groupadd -f -g $NB_GID $NB_GROUP
# Add user
useradd -u $NB_UID -g $NB_GID -d $NB_HOME -N $NB_USER
chown -R $NB_UID:$NB_GID $NB_HOME
cd $NB_HOME
exec gosu $NB_UID "$@"
build and run:
DOCKER_BUILDKIT=1 docker build . -t jupyter
docker run -p 18888:8888 jupyter
then open the jupyter notebook in browser, and no nbextension option appears.
Look at devtools, and there is net::ERR_ABORTED 404 (Not Found)
for /static/notebook/js/mathjaxutils.js
.
Expected behavior
no 404 error.
Desktop (please complete the following information):
- OS: jupyter service is in docker, Web Brower is in Windows10
- Browser: appears in Both Chrome And Edge
Is there a way to fix this? It prevents me from using extension.