繁体   English   中英

从 docker 映像运行 jupyter 笔记本时出现问题

[英]Problem with running jupyter notebook from docker image

I have installed the following docker image with the jupyter notebook installed - 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 教程,这不是所需的行为,我想查看运行它的目录的内容。

解决方案相当简单。 在阅读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是您打算使用的目录的路径。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM