代码之家  ›  专栏  ›  技术社区  ›  blue-sky

暴露jupyter容器的备用端口不工作

  •  0
  • blue-sky  · 技术社区  · 7 年前

    https://hub.docker.com/r/jupyter/r-notebook/ )在10000端口。

    docker run -p 10000:10000 jupyter/r-notebook
    

    这是输出:

    Executing the command: jupyter notebook
    [I 14:14:28.508 NotebookApp] Writing notebook server cookie secret to /home/jovyan/.local/share/jupyter/runtime/notebook_cookie_secret
    [I 14:14:28.954 NotebookApp] JupyterLab extension loaded from /opt/conda/lib/python3.7/site-packages/jupyterlab
    [I 14:14:28.955 NotebookApp] JupyterLab application directory is /opt/conda/share/jupyter/lab
    [I 14:14:28.959 NotebookApp] Serving notebooks from local directory: /home/jovyan
    [I 14:14:28.959 NotebookApp] The Jupyter Notebook is running at:
    [I 14:14:28.959 NotebookApp] http://(165e94335316 or 127.0.0.1):8888/?token=45a5ff037dfa5dfd8aca69ae8489b4bb814009a9b7f6abf6
    [I 14:14:28.959 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
    [C 14:14:28.961 NotebookApp]
    
        Copy/paste this URL into your browser when you connect for the first time,
        to login with a token:
            http://(165e94335316 or 127.0.0.1):8888/?token=45a5ff037dfa5dfd8aca69ae8489b4bb814009a9b7f6abf6
    

    从输出:

    to login with a token:
                http://(165e94335316 or 127.0.0.1):8888/?token=45a5ff037dfa5dfd8aca69ae8489b4bb814009a9b7f6abf6
    

    能看见港口吗 8888 是暴露而不是 10000

    访问 http://localhost:10000/ http://127.0.0.1:10000/ http://165e94335316:10000/ 在浏览器上返回“未找到页面”错误。

    1 回复  |  直到 7 年前
        1
  •  1
  •   Bless dontHaveName    7 年前

    使用 docker run -p 10000:8888 jupyter/r-notebook 和访问 http://localhost:10000 . 右侧端口应为 8888 因为所有Jupyter笔记本电脑容器都暴露在端口上 8888 可以看出 here

    在里面 -p 10000:8888 , 8888 是jupyter笔记本在容器中运行的端口。 10000 容器中运行的笔记本向主机暴露的端口。

    还有一个提示: http://localhost:8888 改变 10000 8888 .

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