docker - Juypterlab的Docker容器

标签 docker jupyter jupyter-lab

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

当我复制
http://(e7ed07c07f1e或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"]

最佳答案

When I copy http://(e7ed07c07f1e or 127.0.0.1):8888/?token=a0dd4edab37a679497593f8e565c75e8fa5d1939fa8cc003 in the browser, the browser seaches in google.



这不是有效的网址。

首先,您需要通过暴露相关端口来启动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

并使用 token 访问网页:
http://127.0.0.1:8888/?token=a0dd4edab37a679497593f8e565c75e8fa5d1939fa8cc003

enter image description here

关于docker - Juypterlab的Docker容器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52990421/

相关文章:

docker中的Java应用程序: Failed to get driver instance for postgres

python3用于单元测试: AttributeError: module '__main__' has no attribute "kernel..."

python - 在 Python2 上运行 jupyter notebook 有困难

python - 创建列列表并使用 Pandas (Python) 将它们汇总到一个新列中

docker - Docker Swarm上的Hadoop集群-数据节点无法连接到Namenode

docker - 在集群模式下使用docker engine 1.12.3之后,互锁或注册者仍然有用吗?

docker - 在Docker容器中运行简单的Elixir应用程序时出错

pyspark - 运行pyspark时出错

jupyter - 当 Jupyter 从 Ubuntu WSL 运行时,如何访问存储在 Windows 中的 Jupyter notebook?

python - 使用 Jupyter Lab 编辑幻灯片