Windows10にDockerを入れてJupyter Notebookをコンテナで動かす
3197 ワード
はじめに
Google Colaboratory上でお手軽にWebスクレイピングとかしてみたかったけど、ログインが必要なページ等は無理そうなので方向を変えてWindows 10上のDockerコンテナで構築してみる。
まずは、試しにJupyter Notebookを動かしてみる。
環境
- Windows 10 Pro (1803)
Docker for Windowsのインストール
-
公式ページ からダウンロード
- DockerIdが必要なので、未登録の場合は登録してからDLする
- インストーラーを起動してインストール
Dockerの動作確認
WindowsPowerShell等で下記コマンドを実行してhello worldのイメージが起動することを確認
$ docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
9db2ca6ccae0: Pull complete
Digest: sha256:4b8ff392a12ed9ea17784bd3c9a8b1fa3299cac44aca35a85c90c5e3c7afacdc
Status: Downloaded newer image for hello-world:latest
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/engine/userguide/
Jupyter Notebookの公式イメージからコンテナを起動
$ docker run -d -p 8888:8888 -v ${pwd}:/home/jovyan/work jupyter/scipy-notebook start-notebook.sh --NotebookApp.token=''
ブラウザでアクセス
http://localhost:8888
NotebookApp.tokenを空文字にして起動しているのでパスワード入力無しでアクセス出来ます。
また、-vでコンテナを起動したディレクトリをマウントしているので、保存したファイル等はその場所に永続化されます。
以前にGoogle Colaboratory上で動かしてみた気温グラフ表示もJupyter上で動きました。
Author And Source
この問題について(Windows10にDockerを入れてJupyter Notebookをコンテナで動かす), 我々は、より多くの情報をここで見つけました https://qiita.com/FrozenVoice/items/248e9fdd47965713e73c著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .