无法在Binder中运行Jupyter笔记本

4

Binder 项目看起来很有前途。 它通过构建可执行容器来帮助在 github 存储库中执行笔记本。 我正在尝试使用以下 Dockerfile 在 binder 中构建可执行容器,其中包含 Perl 6Python 3 内核:

FROM sumdoc/perl-6

ENV NB_USER jovyan
ENV NB_UID 1000
ENV HOME /home/${NB_USER}

RUN adduser --disabled-password \
    --gecos "Default user" \
    --uid ${NB_UID} \
    ${NB_USER}


RUN apt-get update \
    && apt-get install -y build-essential \
    git wget libzmq3-dev ca-certificates python3-pip \
    && rm -rf /var/lib/apt/lists/* && pip3 install jupyter notebook --no-cache-dir \
    && zef -v install https://github.com/bduggan/p6-jupyter-kernel.git --force-test \
    && jupyter-kernel.p6 --generate-config





ENV TINI_VERSION v0.16.1
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /usr/bin/tini
RUN chmod +x /usr/bin/tini 
ENTRYPOINT ["/usr/bin/tini", "--"]
COPY . ${HOME}
USER root
RUN chown -R ${NB_UID} ${HOME}
USER ${NB_USER}

EXPOSE 8888

CMD ["jupyter", "notebook", "--port=8888", "--no-browser", "--ip=0.0.0.0", "--allow-root"]

Binder构建容器后启动此窗口: 输入图像描述 尝试运行Perl 6Python 3笔记本时,我遇到了这个错误: 输入图像描述 我阅读了这篇有关binder的文档,但没有成功。
我错过了什么?任何带有解释的帮助将不胜感激。

也许可以添加一个 python3(或者其他应该使用的标签)标签? - raiph
1个回答

2

在查看了这个Dockerfile后,我解决了这个问题。

我甚至写了一篇关于在Binder中使用Perl 6笔记本的博客。

我错过的是在我的Dockerfile中在USER ${NB_USER}之后添加WORKDIR $HOME,如下所示:

FROM sumankhanal/perl-6

ENV NB_USER jovyan
ENV NB_UID 1000
ENV HOME /home/${NB_USER}

RUN adduser --disabled-password \
    --gecos "Default user" \
    --uid ${NB_UID} \
    ${NB_USER}


RUN apt-get update \
    && apt-get install -y build-essential \
    git wget libzmq3-dev ca-certificates python3-pip \
    && rm -rf /var/lib/apt/lists/* && pip3 install jupyter notebook --no-cache-dir \
    && zef -v install https://github.com/bduggan/p6-jupyter-kernel.git --force-test \
    && jupyter-kernel.p6 --generate-config





ENV TINI_VERSION v0.16.1
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /usr/bin/tini
RUN chmod +x /usr/bin/tini 
ENTRYPOINT ["/usr/bin/tini", "--"]
COPY . ${HOME}
USER root
RUN chown -R ${NB_UID} ${HOME}
USER ${NB_USER}

WORKDIR ${HOME}

EXPOSE 8888

CMD ["jupyter", "notebook", "--port=8888", "--no-browser", "--ip=0.0.0.0", "--allow-root"]

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接