How to use jupyter notebook without polluting your environment with Docker

Docker installation

If Docker is not installed, install it.

Install Docker on Mac (Update: 2019/7/13) --Qiita

(Option) Use Docker completion commands

Since many Docker commands are long, it is better to be able to complete them on the shell.

Command line completion — Docker-docs-ja 17.06.Beta documentation

Docker for mac tab completion --ytooyama blog

Google teacher will teach you how to do it, so please try it.

Pull jupyter image

After installing Docker, use the pull command to download the jupyter image.

docker pull jupyter/datascience-notebook

Edit docker-compose.yml

version: '3'
services:
  jupyter: 
    volumes:  #Mount the current directory to the myapp directory inside the docker container
      - .:/myapp
    working_dir: /myapp  #Container default working dir to myapp
    ports:
      - "8888:8888"  #Container side: Host machine side
    image: "jupyter/datascience-notebook"
    container_name: "notebook"  #Container name (If set, it will be easier to restart)

You can start jupyter notebook in the place where you put this yaml file by changing the place of volumes to ↑. Please rename / myapp as you like. Let's create it in the directory you want to mess with, such as when you want to mess with gorigori data with Python.

Start with docker-compose up

If you can do it so far, do docker-compose up as it is. The URL that started the notebook will be printed on the terminal, so if you go there you should be able to use the jupyter notebook.

Recommended Posts

How to use jupyter notebook without polluting your environment with Docker
How to use jupyter notebook with ABCI
How to use Jupyter Notebook
I wanted to use jupyter notebook with docker in pip environment (opticspy)
How to touch Jupyter Notebook without polluting the environment other than Pythonista, or how to touch Ruby with Jupyter Notebook without polluting the environment other than Rubyist
I want to use a virtual environment with jupyter notebook!
How to use tensorflow under docker environment
Jupyter Notebook Basics of how to use
How to use Jupyter notebook [Super Basic]
How to debug with Jupyter or iPython Notebook
Analytical environment construction with Docker (jupyter notebook + PostgreSQL)
Virtual environment construction with Docker + Flask (Python) + Jupyter notebook
Use pip with Jupyter Notebook
How to use IPython Notebook
Use Cython with Jupyter Notebook
How to use jupyter lab in Windows 10 local environment
How to quickly create a machine learning environment using Jupyter Notebook with UbuntuServer 16.04 LTS
How to use Docker to containerize your application and how to use Docker Compose to run your application in a development environment
pyenv, virtualenv Use docker to manage the environment without using
How to use virtualenv with PowerShell
Use markdown with jupyter notebook (with shortcut)
How to use FTP with Python
Easy to use Jupyter notebook (Python3.5)
How to quickly create a machine learning environment using Jupyter Notebook with UbuntuServer 16.04 LTS with anaconda
How to batch start a python program created with Jupyter notebook
How to build Python and Jupyter execution environment with VS Code
Learn how to use Docker through building a Django + MySQL environment
Use nb extensions with Anaconda's Jupyter notebook
Build Jupyter Lab (Python) environment with Docker
Use apache Spark with jupyter notebook (IPython notebook)
How to easily create an environment where python code runs on Jupyter without polluting the local environment
How to create an NVIDIA Docker environment
I want to blog with Jupyter Notebook
How to use ManyToManyField with Django's Admin
How to use OpenVPN with Ubuntu 18.04.3 LTS
Use Jupyter Lab and Jupyter Notebook with EC2
How to use Cmder with PyCharm (Windows)
How to use Ass / Alembic with HtoA
How to execute commands in jupyter notebook
How to use Japanese with NLTK plot
Use BigQuery from your local Jupyter Notebook
To import your own module with jupyter
How to use CUT command (with sample)
How to quickly create a machine learning environment using Jupyter Notebook on macOS Sierra with anaconda
How to use SQLAlchemy / Connect with aiomysql
How to install python3 with docker centos
How to use JDBC driver with Redash
Specify the browser to use with Jupyter Notebook. Especially Mac. (And Vivaldi)
How to use GCP trace with open Telemetry
How to delete log with Docker, not to collect log
Try using conda virtual environment with Jupyter Notebook
How to use tkinter with python in pyenv
How to use pip3 under proxy environment Note
Jupyter Notebook Settings-How to use (EC2 Amazon Linux 2)
Add / remove kernel to use jupyter with venv
How to deal with "No module named'〇〇'" error in Jupyter Notebook | Install with! Pip!
How to use xml.etree.ElementTree
How to use Python-shell
How to use tf.data
How to use virtualenv
Easily prepare a Jupyter Notebook environment with Docker (Tensorflow and Graphviz are also available)