This website collects cookies to deliver better user experience
How to run JupyterLab on Docker
How to run JupyterLab on Docker
Jupyter and JupyterLab are great tools for data science. Sometimes it is more convenient to simply run them with Docker as containers, which can be easily stopped and deleted after use.
Selecting the image
Jupyter has a lot of images at Docker Hub. Fortunately, Jupyter documentation covers this topic very well. Here, I will use the jupyter/datascience-notebook image, which "includes libraries for data analysis from the Julia, Python, and R communities".
Running with Docker Compose
I particularly like to create a Docker Compose file for each service I use with Docker, because it is better to manage all the necessary options.
First, you have to map the port of the service to a port at your computer. I recommend using the same default port as Jupyter.
Now, it will just be necessary to define two environment variables, JUPYTER_ENABLE_LAB and JUPYTER_TOKEN. Here, you can define the most convenient token for you.