无法在docker中打开jupyter笔记本

时间:2018-06-19 02:14:16

标签: python docker jupyter-notebook jupyter pytorch

我试图在一个容器中打开jupyter笔记本,但我刚刚遇到这种情况: [I 10:01:25.051 NotebookApp] Jupyter笔记本运行于: [I 10:01:25.051 NotebookApp] http://8c1eb91f0492:8888/?token=7671a7abe557349c8d8ad1cbf207702451925efd2c27c84e [I 10:01:25.051 NotebookApp]使用Control-C停止此服务器并关闭所有内核(两次跳过确认)。 [C 10:01:25.051 NotebookApp]

<div><a class="expand-one" href="#">[ - ]</a></div>
<div class="clearboth"></div>
<div class="content-one">
    // Content in here
</div>

<div><a class="expand-two" href="#">[ - ]</a></div>
<div class="clearboth"></div>
<div class="content-two">
    // Content in here
</div>

<div><a class="expand-three" href="#">[ - ]</a></div>
<div class="clearboth"></div>
<div class="content-three">
    // Content in here
</div>

<script>
    $(document).ready(function(){
        $('.expand-one').click(function(){
            $('.content-one').slideToggle('slow');
            return false;
        });
        $('.expand-two').click(function(){
            $('.content-two').slideToggle('slow');
            return false;
        });
        $('.expand-three').click(function(){
            $('.content-three').slideToggle('slow');
            return false;
        });
    });
</script>

正如您所看到的url是容器ID,我尝试了很多解决方案,比如ip设置。一切都没有帮助。有人可以给出提示吗?提前谢谢!

1 个答案:

答案 0 :(得分:2)

尝试逐步使用localhost:

1 - 启动以下命令:

docker run -p 8888:8888 jupyter/scipy-notebook

2 - 将网址网址复制/粘贴到您的浏览器中:http://e6ef92c5e5d6:8888/?token= ...

3 - 用localhost替换主机名:http://localhost:8888/?token= ...

它对我有用:

[I 03:22:51.414 NotebookApp] 302 GET /?token=... (172.17.0.1) 0.97ms