LoginSignup
87
88

More than 5 years have passed since last update.

DockerでJupyter Notebook環境をお手軽に準備する(TensorflowやGraphvizもあるよ)

Last updated at Posted at 2016-02-26

はじめに

ちょっとデータ分析や機械学習をやってみたい、んだけど環境準備が少し面倒だとか、
ハンズオンとかやるんだけど環境セットアップの説明だけで結構時間を使ってしまう、ということがなきにしもあらずかと思います。

Jupyter Notebookは機能的にも素晴らしい環境ですし、Webブラウザがあれば使うことができます。そういう環境はDockerに入れておくと便利で、各自のLocalで起動して使うか、クラウドサーバで起動しておけば、Webブラウザがあれば誰でも使えるのでお手軽です。

既に公開されているDocker Containerもあるのですが、いくつか欲しいものが足りないので追加したものを作ったので共有します。

Jupyter Notebook Docker Container

Dockerファイルはここにあります。
https://github.com/mokemokechicken/jupyter-tensorflow

何が入っているか

  • https://github.com/jupyter/docker-stacks/tree/master/datascience-notebook の中身

    * Jupyter Notebook 4.1.x
    * Conda Python 3.x and Python 2.7.x environments
    * pandas, matplotlib, scipy, seaborn, scikit-learn, scikit-image, sympy, cython, patsy, statsmodel, cloudpickle, dill, numba, bokeh pre-installed
    * Conda R v3.2.x and channel
    * plyr, devtools, dplyr, ggplot2, tidyr, shiny, rmarkdown, forecast, stringr, rsqlite, reshape2, nycflights13, caret, rcurl, and randomforest pre-installed
    * Julia v0.3.x with Gadfly and RDatasets pre-installed
    
  • tensorflow-0.7.1 (python2, python3), skflow

  • pydot2, pygraphviz

使い方

  • 8888ポートで動かす
  • ホストマシンのカレントディレクトリ以下の notebooks/ にファイルを永続化
  • パスワードは環境変数PASSWORDにセット

という感じで動かす場合は、以下のようになります。

run.sh
docker run -d -p 8888:8888 -v `pwd`/notebooks:/home/jovyan/work -e PASSWORD="$PASSWORD" -e GRANT_SUDO=yes --user root mokemokechicken/jupyter-tensorflow start-notebook.sh

基本的にOptionは https://github.com/jupyter/docker-stacks/tree/master/datascience-notebook と同じなので、そちらも参考にしてください。

さいごに

社内に一つこういうのを配備しておくと、ちょっとした作業の共有や勉強などに便利かなーと思っています。

87
88
0

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
87
88