【发布时间】:2019-09-17 12:51:30
【问题描述】:
我有一个 jupyter 笔记本和一个文件夹中的数据文件。我做了一个 Dockerfile 并写了以下几行
FROM jupyter/base-notebook
ARG export_file=FooD_Kind.csv
RUN pip install jupyter
RUN pip install numpy
RUN pip install matplotlib
RUN pip install pandas
RUN pip install pulp
COPY $export_file FooD_Kind.csv
COPY task_4kind.ipynb /
CMD ["jupyter notebook", "task_4kind.ipynb"]
我可以使用docker build -t nameofimage 成功构建图像但是当我使用docker run -it nameofimage 时。我收到一个错误[FATAL tini (7)] exec jupyter notebook failed: No such file or directory。
如何在 docker 中运行这个 jupyter notebook?
编辑:
我在最后一行尝试了两个替换,
我用
# Start the jupyter notebook
ENTRYPOINT ["jupyter", "notebook", "--ip=*"]
它运行并在屏幕上给出一个令牌,但是当我将令牌粘贴到本地主机上时,它给出了无效凭据错误
然后我用
替换了最后一行CMD jupyter notebook --port=8888 --no-browser --ip=0.0.0.0 --allow-root
它运行并在屏幕上给出一个令牌,但是当我将令牌粘贴到本地主机上时,它给出了无效凭据错误
【问题讨论】:
标签: python docker jupyter-notebook