LoginSignup
1
4

More than 5 years have passed since last update.

コンテナ上に自由なJupyterLab環境を作成する

Last updated at Posted at 2019-03-17

手軽な公式のやりかたもあるが、やっぱり自由も欲しい
c.f.
https://github.com/jupyter/docker-stacks

  • ベースイメージからコンテナを起動してアタッチ
    docker run -it -p 8888:8888 python:latest bash
  • パッケージの更新
    apt update -y
  • JupyterLabをインストール
    pip install jupyterlab
  • 使用したいモジュールをインストール
    pip3 install flickrapi
  • JupyterLabの起動
    jupyter lab --no-browser --ip=0.0.0.0 --allow-root
    以下のように出ればとりあえず成功

[I 05:21:51.334 LabApp] JupyterLab extension loaded from /usr/local/lib/python3.7/site-packages/jupyterlab
[I 05:21:51.334 LabApp] JupyterLab application directory is /usr/local/share/jupyter/lab
[W 05:21:51.336 LabApp] JupyterLab server extension not enabled, manually loading...
[I 05:21:51.338 LabApp] JupyterLab extension loaded from /usr/local/lib/python3.7/site-packages/jupyterlab
[I 05:21:51.338 LabApp] JupyterLab application directory is /usr/local/share/jupyter/lab
[I 05:21:51.339 LabApp] Serving notebooks from local directory: /
[I 05:21:51.339 LabApp] The Jupyter Notebook is running at:
[I 05:21:51.339 LabApp] http://(32ec95df752d or 127.0.0.1):8888/?token=98878accf668ed40ca0c77262697094d1193c3d3e81fcf06
[I 05:21:51.339 LabApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 05:21:51.342 LabApp] 
    
    To access the notebook, open this file in a browser:
        file:///root/.local/share/jupyter/runtime/nbserver-133-open.html
    Or copy and paste one of these URLs:
        http://(container-id or 127.0.0.1):8888/?token=98878accf668ed4dasdasdasdsd97094d1193c3d3e81fcf06

マウントは適当に設定して下さいー。

あでぃおす

1
4
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
4