Skip to content

Instantly share code, notes, and snippets.

@aprossi
Last active September 26, 2021 07:16
Show Gist options
  • Save aprossi/15d79fdef5706167da129be90e2ebc70 to your computer and use it in GitHub Desktop.
Save aprossi/15d79fdef5706167da129be90e2ebc70 to your computer and use it in GitHub Desktop.

Run Jupyterlab on docker

Build starting from a Jupyter 2.x image.

Build

docker build -t jupyterlab .

using the following Dockerfile

FROM jupyter/datascience-notebook
MAINTAINER apr
RUN pip install npm
RUN pip install jupyterlab
RUN jupyter serverextension enable --py jupyterlab

Run

see https://github.com/jupyter/docker-stacks/tree/master/datascience-notebook and https://github.com/jupyter/jupyterlab

docker run --rm -ti -p 8888:8888 jupyterlab:latest /bin/bash

and then from within bash

jovyan@6fde26ed0fda:~/work$ jupyter lab

or, mounting local directory (after that one should run from the shell jupyter lab):

docker run --rm -ti -v `pwd`:/home/jovyan/work/data -p 8888:8888 jupyterlab:latest /bin/bash

or, launching without interactive terminal

docker run --rm -v `pwd`:/home/jovyan/work/data -p 8888:8888 jupyterlab:latest /opt/conda/bin/jupyter lab

a browser window open on localhost:8888 should return:

@hendra-herviawan
Copy link

hendra-herviawan commented Jul 22, 2018

Hi,

How to run jupyterlab on docker at startup from specific user (root or not root) ?

Update, After trial & error
docker run --name jupyterlab --restart unless-stopped -v pwd:/home/jovyan/work/data -p 8888:8888 jupyterlab:latest /opt/conda/bin/jupyter lab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment