I am new to Docker and pulled a jupyter/datascience-notebook using
docker pull jupyter/datascience-notebook
I then ran:
docker run eaac14a737db to start the container
One of the last lines gave me a url: http://127.0.0.1:8888/?token=fc99f4e80383e7ba3c50a805ebe312766c1e66a3e15da8cc
I pasted that in, and came to the login page of the Jupyter Notebook, where Token authentication is required.
I copied the token from the last line (fc99f4e80383e7ba3c50a805ebe312766c1e66a3e15da8cc) into the box, but to no avail.
Am I missing something obvious?
I ran jupyter notebook list command to see active sessions, and pasted the key in, but then was redirected to my regular jupyter notebook homepage, which is running python from my local machine, and not in the docker container.
I found a solution, and this is the way I did it:
1 - run docker ps -a to see containers presently loaded
2 - run docker system prune to remove all stopped containers
3 - run docker stop ea34 to stop any continer running, and remove it wtih docker system prune
4 - search images with docker images
5 - run docker run -p 8888:8888 --name jupyter folium2
6 - got this:
Of course I don’t type that in every time. I created an alias that I stored in my ~/.bash_profile file (I’m on a Mac). This is the line I put in my ~/.bash_profile:
alias jupyter='docker run --rm -p 8888:8888 -v $(PWD):/opt/notebooks continuumio/anaconda3 /bin/bash -c "/opt/conda/bin/jupyter notebook --ip=0.0.0.0 --port=8888 --notebook-dir=/opt/notebooks --allow-root --no-browser"'
The key things here are -v $(PWD):/opt/notebooks which shares your current working directory in the Docker container. This way your files are saved on your computer and not inside the container. The other key parameters are --allow-root --no-browser because docker containers run as root by default and the container cannot see the browser on your computer so you must tell Jupyter not to look for one.
Then whenever I want to use a Jupyter notebook, I change into the directory where I want/have my notebook .ipynb files and I just type:
$ jupyter
and I paste the URL in my browser and it all works.
soooo I didn’t close the page, I stop the server with the command
docker stop data_science
then I removed the conteiner with
docker rm data_science
I create a new container with the first command I wrote here, and use the new token it gave to set a password in the token authentication page (there is an option at the end of the page).
After that, every time I stop and start my container, the jupyter page (http://127.0.0.1:8888/) just ask for the password.
I’m trying to run Jupyter using your commands. It partially works, if I run this command sudo docker run --user root -p 8888:8888 -v $PWD:/home/jovyan -e CHOWN_HOME=yes -e CHOWN_HOME_OPTS='-R' --name notebook jupyter/tensorflow-notebook
I get the following error chown: cannot access '/home/jovyan/.gvfs': Permission denied
I’m running Docker on remote server, but I don’t know it much.
Command in background, the token to open Jupyterlab doesnt work docker run -d -p 8888:8888 -e JUPYTER_ENABLE_LAB=yes jupyter/minimal-notebook:latest
Command run in foreground, the token to open Jupyterlab works docker run -p 8888:8888 -e JUPYTER_ENABLE_LAB=yes jupyter/minimal-notebook:latest
I am running docker on ec2 instance and I ssh to access the notebooks in local.