This is binderhub-ready repository template for launching specific interfaces on binderhub instances while running a MongoDB server.
Launching this repository on binderhub instances
Binderhub uses repo2docker for launching and serving computational environments. Repo2docker supports multiple interfaces, such as Jupyter, JupyterLab, VSCode, etc. Mybinder.org is a public service for launching binder instances on a federation of Binderhub deployments. Read more on My Binder Federation.
The list below provides badges/hyperlinks for launching one of the interfaces on different binderhub instances.
[Option 1] Launching this lab as a local container from a remote git repository using repo2docker
- On a terminal, enter a folder of your preference and create a new Python virtual environment (venv):
python3 -m venv venv
- Activate your virtual environment (you may do this again later if you want to restart your container):
source venv/bin/activate
- Install/upgrade required Python libs using pip:
pip install jupyter-repo2docker pip -U
- Launch the Docker container using
repo2docker
directly from the remote repository:
jupyter-repo2docker -p 8888:8888 https://github.com/thedatasociety/lab-mariadb \
jupyter lab --ip 0.0.0.0 --NotebookApp.token='mytoken'
Each interface will be available at a specific path, as follows:
-
JupyterLab: http://127.0.0.1:8888/lab?token=mytoken
See the repo2docker documentation for more details regarding the use of multiple interfaces and other configs.
[Option 2] Launching this lab as a local container from a local git repository using repo2docker
- First, on a terminal, clone this git repository:
git clone https://github.com/thedatasociety/lab-mariadb.git
- Enter the repository folder (
cd lab-mariadb
) and create a new Python virtual environment (venv):
python3 -m venv venv
- Activate your virtual environment (you may do this again later if you want to restart you container)
source venv/bin/activate
- Install/upgrade required Python libs using pip:
pip install jupyter-repo2docker pip -U
- launch the Docker container using repo2docker
jupyter-repo2docker -p 8888:8888 ./ jupyter lab --ip 0.0.0.0 --NotebookApp.token='mytoken'
If you want to map the local git folder inside the container, run
jupyter-repo2docker -p 8888:8888 -v $(pwd):$(echo ~)/host-folder \
./ jupyter lab --ip 0.0.0.0 --NotebookApp.token='mytoken'
Each interface will be available at a specific path, as follows:
-
JupyterLab: http://127.0.0.1:8888/lab?token=mytoken
Both repo2docker options above launch a container on port 8888
. Option 2 also creates a Docker volume that maps current local folder home into the container (host-folder
folder inside the Jupyter Lab/Vscode context).
Before running it, make sure your local user is in the docker
group. Please refer to this Docker documentation for more details. It is strongly advised to not to run the container as root.
Please also be aware that the --ip 0.0.0.0
is a directive that will start a sever which will accept connections from any ip. For security purposes the --NotebookApp.token='mytoken'
directive forces the use of a security token for accessing any interface. Use mytoken
to login or feel free to set a stronger token.