【问题标题】:Docker container for juypterlabjupyterlab 的 Docker 容器
【发布时间】:2023-03-17 23:10:02
【问题描述】:

我想在一个子域中使用 adminuser 和另外 10 个用户运行 jupyterlab。我的第一步是构建一个 Dockerfile。当我运行 docker jupyter 时,我无法使用此令牌登录。 有警告 JupyterLab 服务器扩展未启用,手动加载.. 如何修复警告?

当我复制 http://(e7ed07c07f1e or 127.0.0.1):8888/?token=a0dd4edab37a679497593f8e565c75e8fa5d1939fa8cc003 在浏览器中,浏览器在google中搜索。

我收到这条消息:

Step 7/7 : ENTRYPOINT ["jupyter", "lab", "--allow-root","--ip=0.0.0.0", "--no-browser"]
 ---> Running in 1c47b913a54c
Removing intermediate container 1c47b913a54c
 ---> 9068548fcfbb
Successfully built 9068548fcfbb
Successfully tagged jupyter:latest
[jklein@tobbie jupyter]$ docker run jupyter
[I 11:24:19.707 LabApp] Writing notebook server cookie secret to /root/.local/share/jupyter/runtime/notebook_cookie_secret
[I 11:24:20.018 LabApp] JupyterLab extension loaded from /opt/conda/lib/python3.7/site-packages/jupyterlab
[I 11:24:20.018 LabApp] JupyterLab application directory is /opt/conda/share/jupyter/lab
[W 11:24:20.020 LabApp] JupyterLab server extension not enabled, manually loading...
[I 11:24:20.022 LabApp] JupyterLab extension loaded from /opt/conda/lib/python3.7/site-packages/jupyterlab
[I 11:24:20.022 LabApp] JupyterLab application directory is /opt/conda/share/jupyter/lab
[I 11:24:20.023 LabApp] Serving notebooks from local directory: /
[I 11:24:20.023 LabApp] The Jupyter Notebook is running at:
[I 11:24:20.023 LabApp] http://(e7ed07c07f1e or 127.0.0.1):8888/?token=a0dd4edab37a679497593f8e565c75e8fa5d1939fa8cc003
[I 11:24:20.023 LabApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 11:24:20.023 LabApp]

    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
        http://(e7ed07c07f1e or 127.0.0.1):8888/?token=a0dd4edab37a679497593f8e565c75e8fa5d1939fa8cc003

Dockerfile

FROM continuumio/miniconda3

# Updating and upgrading packages
RUN apt-get update -y \
    && apt-get install -y \
    && apt-get upgrade -y \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

RUN conda update -y conda
RUN conda install -y jupyter \
                     jupyterlab

# Setup application
EXPOSE  8888
ENTRYPOINT ["jupyter", "lab", "--allow-root","--ip=0.0.0.0", "--no-browser"]

【问题讨论】:

    标签: docker jupyter jupyter-lab


    【解决方案1】:

    当我复制http://(e7ed07c07f1e 或 127.0.0.1):8888/?token=a0dd4edab37a679497593f8e565c75e8fa5d1939fa8cc003 在浏览器中,浏览器在google中搜索。

    这不是一个有效的 URL。

    首先,您需要通过公开相关端口来启动您的 docker 容器。运行以下。

    docker run -d -p 8888:8888 <IMAGE_ID>
    

    验证:

    docker ps
    CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                    NAMES
    bafcbb8ddd23        b443ffa510a4        "jupyter lab --allow…"   3 seconds ago       Up 2 seconds        0.0.0.0:8888->8888/tcp   adoring_hypatia
    

    并使用令牌访问网页:

    http://127.0.0.1:8888/?token=a0dd4edab37a679497593f8e565c75e8fa5d1939fa8cc003
    

    【讨论】:

    • 对不起,我无法启动 jupyterlab。请查看我的 Dockerfile
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-10-04
    • 1970-01-01
    • 2019-12-15
    • 2019-04-08
    • 2021-07-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多