This is the third day article of Python Advent Calendar 2015.
If you try to use Jupyter (IPython Notebook) including various packages on Windows or Mac, installation is difficult. So, this time, I will explain how to start Jupyter on Windows (64-bit) using Docker. Please check DockerHub for available packages. If you want to do it quickly, see [How to use Docker Toolbox](# docker-toolbox). If you want to try various things, see [How to use Docker with Ubuntu](How to use docker with #ubuntu).
By using Docker Toolbox, you can easily use Docker. After installing Docker Toolbox, you can use the following software.
--Docker Client: Operate in shell --Docker Machine: Creating a host --Docker Compose: Multiple container operation --Docker Kitematic: Operate with GUI --VirtualBox: Execution of virtual OS (CoreOS)
Please download and install the installer from Docker Toolbox.
If you use Kitematic in Docker Toolbox, you can operate Docker from the GUI. Start Kitematic. Enter [tsutomu7 / jupyter] in the search text as shown below and press the [CREATE] button.
After a while, the status will change to [RUNNING]. You can save the file on Windows by clicking [/ jupyter] under [VOLUMES] at the bottom right and selecting [Enable Volumes]. Click under [WEB PREVIEW] to start the browser and use Jupyter.
Select [Python3] from [New] on the upper right of your browser.
When [Untitled1.ipynb] opens, type "! Conda list" and press [Shift + Enter] to display a list of installed packages.
The following will be explained in order.
--[Install VirtualBox](Install #virtualbox) -[Install Ubuntu](Install #ubuntu) -[Register and start virtual machine](# Register and start virtual machine) -[Ubuntu settings](#ubuntu settings) -[Start Ubuntu and install Docker](Start #ubuntu and install docker) -[Start Jupyter](Start #jupyter)
Download and install your OS installer from Download VirtualBox. Although not required, [Introduction of Extension Pack](http://vboxmania.net/content/%E3%82%A8%E3%82%AF%E3%82%B9%E3%83%86%E3% 83% B3% E3% 82% B7% E3% 83% A7% E3% 83% B3% E3% 83% 91% E3% 83% 83% E3% 82% AF% E3% 81% AE% E5% B0% It is convenient to do 8E% E5% 85% A5).
Download the Ubuntu 14.04 LTS [^ 1] disk image from Download Virtual Hard Disk Image and unzip it.
Start VirtualBox and press [New]. Specify as below and go to the next.
We recommend a memory size of 2048MB or more. You can change it later. For the hard disk, select [Already ...], click the icon on the right, specify the unzipped Ubuntu 14.04 LTS disk image, and click the [Create] button.
Select Ubuntu14.04 and press [Settings]. It is convenient to set as follows in [Advanced] of [General].
If you have installed the extension pack, you can access and use [Host IP address: 13389] on the remote desktop by setting as follows.
Select [Adapter 2] in [Network] and set as follows. Leave the settings for [Adapter 1] as they are.
For the meaning of the settings, see [Network Settings](http://vboxmania.net/content/%E3%83%8D%E3%83%83%E3%83%88%E3%83%AF%E3%83%BC See% E3% 82% AF% E8% A8% AD% E5% AE% 9A).
Press [Start] to start Ubuntu and log in.
Execute as follows. (Recommended to copy one line at a time)
ubuntu
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo gedit /etc/apt/sources.list.d/docker.list
The editor will open, so please save as follows. 「deb https://apt.dockerproject.org/repo ubuntu-trusty main」
Execute as follows.
ubuntu
sudo apt-get update
sudo apt-get install linux-image-extra-$(uname -r)
Execute as follows.
ubuntu
sudo apt-get update
sudo apt-get install docker-engine
sudo service docker start
You can check the version with "docker --version". For more information, please refer to Installation on Ubuntu.
Please do the following and log in again.
ubuntu
sudo gpasswd -a $USER docker
Start the server with Docker and check it with a browser.
Do the following and remember the IP address after [inet]. This address is used when opening a browser in Windows.
ubuntu
ip addr show eth1
Just do the following:
ubuntu
mkdir jupyter
docker run -d -p 8888:8888 -v $(pwd)/jupyter:/jupyter tsutomu7/jupyter
Try opening the "http: // confirmed IP address: 8888" confirmed above with a Windows browser. Python 3.5 Jupyter will start.
If you want to see it in Ubuntu browser, see "http://172.17.0.2:8888".
Quit the server as follows.
ubuntu
docker stop $(docker ps -aq)
To restart the server, follow the steps below.
ubuntu
docker start $(docker ps -aq)
[^ 1]: On October 23, 2015, Ubuntu 15.10 is the latest, but the latest long-term warranty (LTS) is 14.04.
Recommended Posts