Skip to content

Commit f7427e7

Browse files
updated README.md
1 parent fbfcde1 commit f7427e7

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

README.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,29 @@ Note: This JupyterHub and Jupyter Notebook package was built without Anaconda.
55
## Two ways to set up the container
66

77
### 1. Pull the image from Docker Hub
8-
This is the base build that runs JupyterHub and Jupyter Notebooks with Python 2 and 3 and R 3.3.0 and Scala 2.11 kernels. To use this base build for building docker images that have additional kernels in this repository do a:
8+
This is the base build that runs JupyterHub and Jupyter Notebooks with Python 2 and 3 and R 3.3.0 and Scala 2.11 kernels. Check the "Build Details" link on the Docker page to see if there is any new base build on queue. To use this base build for building docker images that have additional kernels in this repository do a:
99

1010
```
11-
$ docker pull hermantolentino/jupyterhub:latest
11+
$ docker pull hermantolentino/docker-jupyterhub:latest
1212
```
1313

14-
This will download the base build which you can use to run Python 2 and 3, R and Scala notebooks.
14+
This will download the base build which you can use to run Python 2 and 3, R and Scala notebooks. To use this as the base for a new Dockerfile, use the label above in the `FROM:` section of your new Dockerfile. Before "pulling", check the tag for the latest automated build (it may not say 'latest'), and attach that tag to the label (hermantolentino/docker-jupyterhub:**"TAG HERE"**).
1515

1616
### 2. Build it from the Dockerfile
1717

18-
Follow these steps if you want to build the container from the Dockerfile.
18+
Follow these steps if you want to build the container from the Dockerfile from scratch on your machine.
1919

2020
1. On the command line: `$ git clone` this repository.
2121
2. `$ cd docker-jupyterhub`
22-
3. Run this code on the command line: `$ docker build -t hermantolentino/jupyterhub:v3 .` Remember the period - it means use the Dockerfile in the current directory. This will take a while. Make some coffee.
22+
3. Run this code on the command line: `$ docker build -t hermantolentino/jupyterhub:v5 .` Remember the period - it means use the Dockerfile in the current directory and use that directory as __context__ (this enables you use Docker instructions, like `ADD` or `COPY` that copy files from that directory to your container). This will take a while. Make some coffee.
2323

2424
## Running the container
2525

2626
1. There are two ways to run the docker image:
2727

28-
1.1 **Self-contained mode**: Docker container has no access to any host drive. Run `$ docker run -it -p 0.0.0.0:8000:8000 hermantolentino/jupyterhub:v3 /bin/bash`.
28+
1.1 **Self-contained mode**: Docker container you launch will have no access to any host drive directory. Run `$ docker run -it -p 0.0.0.0:8000:8000 hermantolentino/jupyterhub:v5 /bin/bash`.
2929

30-
1.2 **Using current host directory as work directory**: Run `$ docker run -v $(pwd):/home/jupyterhub/hostdir -it -p 0.0.0.0:8000:8000 hermantolentino/jupyterhub:v3 /bin/bash``$(pwd)` substitutes your current directory in the command. `-v` creates a shared volume that enables you to access your current host directory (from where you launch the docker container) inside the container.
30+
1.2 **Using current host directory as work directory**: Run `$ docker run -v $(pwd):/home/jupyterhub/hostdir -it -p 0.0.0.0:8000:8000 hermantolentino/jupyterhub:v5 /bin/bash``$(pwd)` substitutes your current directory in the command. `-v` creates a shared volume that enables you to access your current host directory (from where you launch the docker container) inside the container.
3131

3232
2. This will bring you to the docker container root prompt: `root@"DOCKER IMAGE ID":/home/jupyterhub/#`. In mode 1.1 above when you `cd` to `hostdir` you will enter a blank directory. In mode 1.2 above, you will find the files present in the current host directory from where you launched the container.
3333

@@ -41,11 +41,14 @@ Follow these steps if you want to build the container from the Dockerfile.
4141

4242
## Setting up packages and run version test notebooks
4343
1. To test if the kernels load correctly, you need to load and run the notebooks in the `notebooks` directory from the Jupyter Notebook web interface. Click on each notebook (ends with .ipynb) and press the "run code" button. If the kernels are loaded correctly, you will see the version number of the kernel that runs each notebook.
44-
2. To load the R and Python data science packages in the `packages` directory, you need to SSH or login to a container bash shell other than the one you ran JupyterHub from. Type ``$ docker exec -it "CONTAINER ID or CONTAINER alias" /bin/bash` to do this.
44+
45+
2. To load the R and Python data science packages in the `packages` directory, you need to login to a container bash shell other than the one you ran JupyterHub from. Type ``$ docker exec -it "CONTAINER ID or CONTAINER alias" /bin/bash` to do this.
46+
4547
3. Once in the container root prompt, to load all the packages for R and Python, at the root prompt, type `# ./installpackages.sh`. This will run the scripts for R and Python. **Warning: This really takes a long time!**
46-
4. If you want to load packages in batches, run the following scripts one after the other, at the root prompt: `# packages/r-packages.sh`, `# packages/python-packages.sh`, and `# packages/python-nlp-packages.sh`. Installing additional packages take time:
4748

48-
4.1 **NLTK**: Install NLTK and NLTK data. This takes a long while so one option is to load them as needed at run time (in the notebook) using nltk.download('ID of data set'). The complete set of NLTK data, and the `ID` you need to use for each set, is found here: http://www.nltk.org/nltk_data/.
49+
4. If you want to load packages in batches, run the following scripts one after the other, at the root prompt: `# packages/r-packages.sh`, `# packages/python-packages.sh`, and `# packages/python-nlp-packages.sh`. Installing additional packages takes time:
50+
51+
4.1 **NLTK**: Install NLTK package and NLTK data. This takes a long while so one option is to load them as needed at run time (in the notebook) using nltk.download('ID of data set'). The complete set of NLTK data, and the `ID` of the data set you need to use, is found here: http://www.nltk.org/nltk_data/.
4952

5053
4.2 **GIS**: Install the Python GIS package.
5154

@@ -58,9 +61,11 @@ This container has a `notebooks` directory where there are sample notebooks inst
5861
## Stopping the container
5962

6063
1. You can stop jupyterhub by pressing `^C` twice, this will bring you back to the root prompt.
64+
6165
2. Remember, when you delete the JupyterHub container with `# docker rmi "CONTAINER ID"` all the packages you have installed will be gone. You can do a `# docker commit` before deleting the container instance. Running container instances are listed with `# docker ps`. Running and stopped instances are listed with `# docker ps -a`.
6266

6367
## Notes
6468

6569
1. The JupyterHub configuration file at `/etc/jupyterhub/jupyterhub_config.py` has an insecure configuration. Please read the docs to create a secure configuration for your JupyterHub server.
70+
6671
2. If you want to run JupyterHub from a folder on your computer that has notebooks, ` cd ` to that folder and use: `# docker run -v $(pwd):/home/jupyterhub -it -p 0.0.0.0:8000:8000 hermantolentino/jupyterhub:v3 /bin/bash`. This will substitute your notebook folder for the default container folder `/home/jupyterhub`.

0 commit comments

Comments
 (0)