Most tutorials suggest using Anaconda. However, if you’re low on bandwidth, the pip3-based approach is more lightweight:
sudo apt install python3-pip
sudo pip3 install --upgrade setuptools
sudo pip3 install jupyter
Notes: You have to update setuptools to avoid the error message Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-ril_vnoz/tornado/. According to my experience, do not upgrade pip itself using pip3 install --upgrade pip because it will break things on Ubuntu.
Run the jupyter/datascience-notebook notebook and mount the working directory.
docker run -p 8888:8888 -v "$PWD":/home/jovyan/work jupyter/datascience-notebook
If you’re using SELinux, you need to allow it to mount the directories to Docker:
sudo chcon -Rt svirt_sandbox_file_t .