如何在jupyter / datascience-notebook docker映像中本地存储笔记本?

时间:2019-10-12 10:25:06

标签: docker docker-compose jupyter-notebook

我有一个Jupyter笔记本电脑环境,可与以下代码配合使用:

version: '3'

volumes:
  jupyter:
    driver: local

networks:
  traefik_network:
    external: true

services:
  jupyter:
    image: jupyter/datascience-notebook
    networks:
      - traefik_network
    labels:
      - "traefik.enable=true"
      - "traefik.docker.network=traefik_network"
      - "traefik.port=8888"
      - "traefik.entryPoint=https"
      - "traefik.backend=jupyter"
      - "traefik.frontend.rule=Host:jupyter.mysite.com"
    volumes:
     - jupyter:/home/jovyan/work
    environment:
     - JUPYTER_ENABLE_LAB=yes
    command: start-notebook.sh --NotebookApp.token='mytoken' --no-browser --allow-root --notebook-dir=/home/jovyan/work

但是我想在版本控制中跟踪笔记本。这样我想将音量更改为:

volumes:
     - ./work:/home/jovyan/work

如果那样的话,docker-compose将正常工作而不会发出警告。但是,当您进入jupyter实验室环境并创建笔记本时,会出现“找不到目录”错误。 ./work目录实际上在服务器上。

0 个答案:

没有答案