Skip to content

Commit dfb53ff

Browse files
updated Dockerfiles, README.md, added iRuby, iRuby notebooks
1 parent c3e8190 commit dfb53ff

11 files changed

+4787
-13
lines changed

Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,24 @@ RUN curl -L -o jupyter-scala https://git.io/vrHhi && \
141141
rm -f jupyter-scala
142142
RUN /root/.local/share/jupyter/kernels/scala211/launcher.jar --global --quiet
143143

144+
# Install IRuby and SciRuby 2.1.5
145+
# Based on https://github.com/SciRuby/sciruby and http://sciruby.com/docs/
146+
# and https://www.brightbox.com/docs/ruby/ubuntu/
147+
148+
# Install latest Ruby, Ruby Version Manager
149+
RUN apt-get install -y python-apt python-pycurl software-properties-common
150+
RUN apt-add-repository ppa:brightbox/ruby-ng --yes && \
151+
apt-get update
152+
RUN apt-get install -y ruby2.2 ruby2.2-dev libtool-bin libmagickwand-dev imagemagick bundler gnuplot \
153+
libgsl0-dev zlib1g-dev libatlas-base-dev
154+
RUN apt-get install -y libblas-dev checkinstall && \
155+
apt-get install -y liblapacke-dev checkinstall
156+
RUN gem install erector bundler gnuplot
157+
RUN gem install sciruby-full
158+
# iruby register creates the kernel.json and kernelspec install makes it visible to jupyter
159+
RUN iruby register --force && \
160+
jupyter kernelspec install /root/.ipython/kernels/ruby
161+
144162
# Backup local files to container image
145163
COPY etc/ /root/work/.backup/
146164
COPY etc/ /etc/

Dockerfile-packages

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,24 @@ RUN curl -L -o jupyter-scala https://git.io/vrHhi && \
147147
rm -f jupyter-scala
148148
RUN /root/.local/share/jupyter/kernels/scala211/launcher.jar --global --quiet
149149

150+
# Install IRuby and SciRuby 2.1.5
151+
# Based on https://github.com/SciRuby/sciruby and http://sciruby.com/docs/
152+
# and https://www.brightbox.com/docs/ruby/ubuntu/
153+
154+
# Install latest Ruby, Ruby Version Manager
155+
RUN apt-get install -y python-apt python-pycurl software-properties-common
156+
RUN apt-add-repository ppa:brightbox/ruby-ng --yes && \
157+
apt-get update
158+
RUN apt-get install -y ruby2.2 ruby2.2-dev libtool-bin libmagickwand-dev imagemagick bundler gnuplot \
159+
libgsl0-dev zlib1g-dev libatlas-base-dev
160+
RUN apt-get install -y libblas-dev checkinstall && \
161+
apt-get install -y liblapacke-dev checkinstall
162+
RUN gem install erector bundler gnuplot
163+
RUN gem install sciruby-full
164+
# iruby register creates the kernel.json and kernelspec install makes it visible to jupyter
165+
RUN iruby register --force && \
166+
jupyter kernelspec install /root/.ipython/kernels/ruby
167+
150168
# Backup local files to container image
151169
COPY etc/ /root/work/.backup/
152170
COPY etc/ /etc/

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ Note: This combined JupyterHub and Jupyter Notebook package was built without An
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. 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:
8+
This is the base build that runs JupyterHub and Jupyter Notebooks with Python 2.7 and 3.5, R 3.3.0, Ruby 2.2 and Scala 2.11 kernels. Check the "Build Details" link on the Docker page (https://hub.docker.com/r/hermantolentino/docker-jupyterhub/) 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/docker-jupyterhub:latest
11+
> $ docker pull hermantolentino/docker-jupyterhub:v5
1212
> ```
1313
1414
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', could be 'v4' or 'v5'), and attach that tag to the label (hermantolentino/docker-jupyterhub:**"TAG HERE"**).
@@ -29,7 +29,7 @@ Follow these steps if you want to build the container from the Dockerfile from s
2929
3030
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
32-
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.
32+
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
3434
3. Next, load the R and Python data science packages - See "Setting up packages" below. This will take a while again, have some coffee. If there are any errors, please let me know.
3535
@@ -40,7 +40,7 @@ Follow these steps if you want to build the container from the Dockerfile from s
4040
6. Find the username and password for JupyterHub inside the Dockerfile. You can create another user by logging in to the bash prompt of the container and using `# adduser "username"`.
4141
4242
## Setting up packages and run version test notebooks
43-
1. To test if the R, Scala and Python (2.7 and 3.5) kernels load correctly, you need to load and run the notebooks with "Version" in their filenames in the `notebooks` directory from the Jupyter Notebook web interface. Click on each notebook (file name 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.
43+
1. To test if the R, Scala and Python (2.7 and 3.5) kernels load correctly, you need to load and run the kernel notebooks with "Version" in their filenames in the `notebooks` directory from the Jupyter Notebook web interface. Click on each notebook (file name 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.
4444
4545
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.
4646
@@ -71,10 +71,11 @@ This container has a `notebooks` directory where there are sample notebooks inst
7171
> `
7272
> $ docker build -t hermantolentino/jupyter-packages:v1 -f Dockerfile-packages .`
7373
>
74+
7475
**Warning: This really takes a long time!**
7576
7677
## Notes
7778
78-
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.
79+
Please read the docs to create a secure configuration for your JupyterHub server.
7980
80-
2. If you want to run JupyterHub and use a folder on your computer that has your notebooks, ` cd ` to that folder and use: `# docker run -v $(pwd):/home/jupyterhub/hostdir -it -p 0.0.0.0:8000:8000 hermantolentino/jupyterhub:v5 /bin/bash`. This will make your notebook folder visiable in the container folder `/home/jupyterhub/hostdir`.
81+
If you want to run JupyterHub and use a folder on your computer that has your notebooks, ` cd ` to that folder and use: `$ docker run -v $(pwd):/home/jupyterhub/hostdir -it -p 0.0.0.0:8000:8000 hermantolentino/jupyterhub:v5 /bin/bash`. This will make your notebook folder visiable in the container folder `/home/jupyterhub/hostdir`.

0 commit comments

Comments
 (0)