https://qiita.com/some-nyan/items/a4353cde6939e2dce351
を書いたあと、JupyterLabのβリリースがされていることに気づいてしまった。。。

JupyterLab

Jupyterの進化系、
Jupyterの機能に加えて、ファイルエクスプローラやコンソールも統合され
より統合開発環境として進歩している。

Jupyterの公式DockerイメージとJupyterLab

用途ごとに *-notebook というDockerイメージが公開されています。
JupyterLabのイメージないなぁと思ってREADME読んでたら、base-notebook
のREADMEにこんな一文が!

You can launch JupyterLab by setting JUPYTER_ENABLE_LAB:

やってみた

先日書いた、 docker-compose.yml に2行追加

version: '2.2'
services:
  jupyter:
    image: jupyter/datascience-notebook
    environment:
      JUPYTER_ENABLE_LAB: 1
    ports:
      - 8888:8888
    volumes:
      - ./:/home/jovyan/work
    command: start-notebook.sh --NotebookApp.token=''

すべての *-notebook は base-notebook から派生しているからいけるはず。。

$ docker-compose up
jupyter_1  | Container must be run with group root to update passwd file
jupyter_1  | Executing the command: jupyter lab --NotebookApp.token=
jupyter_1  | [I 00:34:53.528 LabApp] Writing notebook server cookie secret to /home/jovyan/.local/share/jupyter/runtime/notebook_cookie_secret
jupyter_1  | [W 00:34:54.294 LabApp] WARNING: The notebook server is listening on all IP addresses and not using encryption. This is not recommended.
jupyter_1  | [W 00:34:54.294 LabApp] WARNING: The notebook server is listening on all IP addresses and not using authentication. This is highly insecure and not recommended.
jupyter_1  | [I 00:34:54.325 LabApp] JupyterLab beta preview extension loaded from /opt/conda/lib/python3.6/site-packages/jupyterlab
jupyter_1  | [I 00:34:54.325 LabApp] JupyterLab application directory is /opt/conda/share/jupyter/lab
jupyter_1  | [I 00:34:54.338 LabApp] Serving notebooks from local directory: /home/jovyan
jupyter_1  | [I 00:34:54.339 LabApp] 0 active kernels
jupyter_1  | [I 00:34:54.339 LabApp] The Jupyter Notebook is running at:
jupyter_1  | [I 00:34:54.339 LabApp] http://[all ip addresses on your system]:8888/
jupyter_1  | [I 00:34:54.339 LabApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).

それっぽいこと言ってる!

アクセスしてみた

image.png

やったね!

ちなみに

2/28の時点では
0.31.8 が使われていた。

jovyan@65fb03dc67e3:~$ pip list | grep lab
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your p
ip.conf under the [list] section) to disable this warning.
jupyterlab (0.31.8)
jupyterlab-launcher (0.10.4)
广告
将在 10 秒后关闭
bannerAds