【问题标题】:How to run jupyter notebook using docker with ubuntu?如何使用带有 ubuntu 的 docker 运行 jupyter notebook?
【发布时间】:2021-01-20 03:42:52
【问题描述】:

我对 docker 很陌生,不知道如何搜索谷歌来回答我的问题。

我正在使用 Windows 操作系统

我已经创建了 docker 镜像使用

FROM python:3
RUN apt-get update && apt-get install -y python3-pip
COPY requirements.txt .
RUN pip install -r requirements.txt
RUN pip3 install jupyter
RUN useradd -ms /bin/bash demo
USER demo
WORKDIR /home/demo
ENTRYPOINT ["jupyter", "notebook", "--ip=0.0.0.0"]

而且效果很好。现在我尝试再次创建它,但在 requirements.txt 中使用不同的库它无法构建,它输出ERROR: Could not find a version that satisfies requirement apturl==0.5.2。当我搜索apturl是什么时,我认为我们需要ubuntu OS来安装它。

所以我的问题是如何使用带有 ubuntu 库的 docker 创建一个 jupyter notebook 服务器? (我使用的是 Windows 操作系统)。谢谢!

【问题讨论】:

    标签: docker ubuntu jupyter-notebook


    【解决方案1】:

    尝试升级 pip。

    RUN pip install -U pip
    RUN pip3 install -r requirements.txt
    

    【讨论】:

    • 感谢您的评论,但我仍然收到错误消息。
    • 在运行 install requirements.txt 之前运行 install apturl。对我来说工作得很好
    • 据我了解,apturl 是特定于 ubuntu 操作系统的库,不是吗?如果是这样我不必使用ubuntu os而不是windows吗?
    • 你在 Windows 上吗?请在操作上指定操作系统
    • 是的,我使用的是 Windows 操作系统,我指定了它,但可能很难看到,我已将其添加到问题之上,感谢您告诉我。
    猜你喜欢
    • 1970-01-01
    • 2020-11-23
    • 2019-09-17
    • 2016-04-24
    • 1970-01-01
    • 1970-01-01
    • 2023-02-26
    • 1970-01-01
    • 2017-10-29
    相关资源
    最近更新 更多