无法在活页夹中提供jupyter笔记本

时间:2018-01-03 14:54:06

标签: python-3.x docker jupyter-notebook jupyter perl6

Binder项目看起来很有希望。 它有助于通过构建可执行容器在github存储库中执行笔记本。 我正在尝试使用以下具有 Perl 6 Python 3 内核的Dockerfile在binder中构建可执行容器:

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在构建容器后启动此窗口: enter image description here

尝试运行Perl 6Python 3笔记本时遇到此错误: enter image description here

我读了这个documentation on binder但是没有成功。

我缺少什么?任何有关解释的帮助都将不胜感激。

1 个答案:

答案 0 :(得分:1)

经过CassandraServiceImpl.java#L207后,我解决了这个问题。

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

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

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}

WORKDIR ${HOME}

EXPOSE 8888

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