Docker 中运行的 Jupyter Notebook 的本地文件?

kne*_*zle 5 volume docker jupyter-notebook docker-container

背景

我按照 这里的教程 按以下方式进行:

  1. 从 Dockerfile 创建一个图像,然后创建一个用于 TensorFlow 对象检测 API 的容器。

  2. 在 Dockerfile 的末尾,启动了一个 Jupyter Notebook,我可以查看和编辑通过 github 克隆的所有内容。

  3. 我必须做一些修改才能使其工作,但它现在可以工作了。

  4. 然后我将此镜像推送到 Dockerhub,名称为:tf_od_api:part1。

  5. 启动名为tensorflow的容器的命令:

    docker run --runtime=nvidia -it --name tensorflow -p 8888:8888 -d kneazle/tf_od_api:part1

  6. 容器ID是dc91f5b5e6759bac3dfe4e713406fd0e2a217637241a45d9a20d5cfc347d40d8

  7. Jupyter笔记本中的地址localhost:8888


Jupyter笔记本的GUI中没有数据

现在我想使用本地数据(超过 10 GB)进行对象检测,为此我需要使用对象检测 api 中的脚本,该脚本将为将来的任务创建并保存 tfrecords。所以我需要保存这些数据,但又不想每次都上传。我尝试了这里给出的解决方案。我使用的命令是:

docker run -v /home/kneazle/data/KITTI:/data_host/KITTI kneazle/tf_od_api:part1
Run Code Online (Sandbox Code Playgroud)

但是这个命令的输出是:

[I 11:06:50.547 NotebookApp] Writing notebook server cookie secret to /root/.local/share/jupyter/runtime/notebook_cookie_secret
[W 11:06:50.560 NotebookApp] All authentication is disabled.  Anyone who can connect to this server will be able to run code.
[I 11:06:50.564 NotebookApp] Serving notebooks from local directory: /tensorflow/models/research/object_detection
[I 11:06:50.564 NotebookApp] The Jupyter Notebook is running at:
[I 11:06:50.564 NotebookApp] http://(a915e0cd0fd0 or 127.0.0.1):8888/
[I 11:06:50.564 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
Run Code Online (Sandbox Code Playgroud)

我在之前或之后启动的 Jupyter 笔记本中看不到数据。我也尝试过

docker run --runtime=nvidia -it 
    --name tensorflow -p 8888:8888 
    -v /home/kneazle/data/KITTI:/data_host/KITTI kneazle/tf_od_api:part1
Run Code Online (Sandbox Code Playgroud)

如何将本地文件用于在 Docker 中运行的 Jupyter Notebook?