【问题标题】:Problem with running jupyter notebook from docker image从 docker 镜像运行 jupyter notebook 的问题
【发布时间】:2021-01-31 21:36:20
【问题描述】:

我已经安装了以下 docker 镜像并安装了 jupyter notebook - https://hub.docker.com/layers/tensorflow/tensorflow/2.0.4-gpu-jupyter/images/sha256-926eb2502748f0a45607fb35b99a9a19bf20962f1051e7e0a5965b1c83f2d62a?context=explore

当使用以下命令运行它时:

docker run -it --gpus all -p 8888:8888 -u $(id -u):$(id -g) tensorflow/tensorflow:2.0.4-gpu-jupyter

我无法打开出现的本地主机链接(未找到服务器):

http://9f44be49ff10:8888/?token=06bc87bf64e14eb3fc57d3044439ad325ee0f9cc91fd5805

这个链接有效:

http://127.0.0.1:8888/?token=06bc87bf64e14eb3fc57d3044439ad325ee0f9cc91fd5805

但是将我发送到 tensorflow 教程,这不是所需的行为,我想查看运行它的目录的内容。

【问题讨论】:

    标签: python docker jupyter-notebook


    【解决方案1】:

    解决方案相当简单。在阅读Tensorflow dockerhub 时,我需要更加专心。

    为了在特定目录中工作,需要使用标志-v 指定此处https://hub.docker.com/r/tensorflow/tensorflow

    docker run -it --rm -v $(realpath ~/notebooks):/tf/notebooks -p 8888:8888 tensorflow/tensorflow:latest-jupyter

    ~/notebooks 是您打算使用的目录的路径。

    【讨论】:

      猜你喜欢
      • 2019-09-17
      • 1970-01-01
      • 2019-05-23
      • 2021-04-02
      • 2022-10-15
      • 1970-01-01
      • 2016-12-14
      • 2020-10-17
      • 1970-01-01
      相关资源
      最近更新 更多