mkdir ~/jupyter
cd ~/jupyter
touch Dockerfile
vim Dockerfile
Dockerfile
FROM python:3
USER root
RUN apt update && \
apt -y install jupyter-notebook
ENV LANG ja_JP.UTF-8
ENV LANGUAGE ja_JP:ja
ENV LC_ALL ja_JP.UTF-8
ENV TZ JST-9
CMD ["jupyter-notebook", "--port", "8000", "--ip=0.0.0.0", "--allow-root"]
docker build -t jupyter .
docker run --rm -p 8001:8000 jupyter
http://127.0.0.1:8001/?token=~
Jupyter notebook works when connected to
Modify the Dockerfile as iruby is required
Dockerfile
FROM python:3
USER root
RUN apt update && \
apt -y install jupyter-notebook ruby ruby-ffi-rzmq && \
gem install iruby && \
iruby register --force
ENV LANG ja_JP.UTF-8
ENV LANGUAGE ja_JP:ja
ENV LC_ALL ja_JP.UTF-8
ENV TZ JST-9
CMD ["jupyter-notebook", "--port", "8000", "--ip=0.0.0.0", "--allow-root"]
You can now select ruby from new in jupyter notebook -> It works. Yay
The following error occurs without ruby-ffi-rzmq
[I 15:26:42.550 NotebookApp] Kernel started: 70bcadba-f259-40b4-9fd0-1ea479195b0e
F, [2020-06-07T15:26:43.232174 #9] FATAL -- : Kernel died: uninitialized constant IRuby::SessionAdapter::PyzmqAdapter::PyCall
/var/lib/gems/2.5.0/gems/iruby-0.4.0/lib/iruby/session_adapter/pyzmq_adapter.rb:7:in `rescue in load_requirements'
/var/lib/gems/2.5.0/gems/iruby-0.4.0/lib/iruby/session_adapter/pyzmq_adapter.rb:4:in `load_requirements'
/var/lib/gems/2.5.0/gems/iruby-0.4.0/lib/iruby/session_adapter.rb:7:in `available?'
/var/lib/gems/2.5.0/gems/iruby-0.4.0/lib/iruby/session_adapter.rb:63:in `block in select_adapter_class'
/var/lib/gems/2.5.0/gems/iruby-0.4.0/lib/iruby/session_adapter.rb:62:in `each_value'
/var/lib/gems/2.5.0/gems/iruby-0.4.0/lib/iruby/session_adapter.rb:62:in `select_adapter_class'
/var/lib/gems/2.5.0/gems/iruby-0.4.0/lib/iruby/session.rb:112:in `create_session_adapter'
/var/lib/gems/2.5.0/gems/iruby-0.4.0/lib/iruby/session.rb:12:in `initialize'
/var/lib/gems/2.5.0/gems/iruby-0.4.0/lib/iruby/kernel.rb:17:in `new'
/var/lib/gems/2.5.0/gems/iruby-0.4.0/lib/iruby/kernel.rb:17:in `initialize'
/var/lib/gems/2.5.0/gems/iruby-0.4.0/lib/iruby/command.rb:110:in `new'
/var/lib/gems/2.5.0/gems/iruby-0.4.0/lib/iruby/command.rb:110:in `run_kernel'
/var/lib/gems/2.5.0/gems/iruby-0.4.0/lib/iruby/command.rb:40:in `run'
/var/lib/gems/2.5.0/gems/iruby-0.4.0/bin/iruby:5:in `<top (required)>'
/usr/local/bin/iruby:23:in `load'
/usr/local/bin/iruby:23:in `<main>'
Traceback (most recent call last):
15: from /usr/local/bin/iruby:23:in `<main>'
14: from /usr/local/bin/iruby:23:in `load'
13: from /var/lib/gems/2.5.0/gems/iruby-0.4.0/bin/iruby:5:in `<top (required)>'
12: from /var/lib/gems/2.5.0/gems/iruby-0.4.0/lib/iruby/command.rb:40:in `run'
11: from /var/lib/gems/2.5.0/gems/iruby-0.4.0/lib/iruby/command.rb:110:in `run_kernel'
10: from /var/lib/gems/2.5.0/gems/iruby-0.4.0/lib/iruby/command.rb:110:in `new'
9: from /var/lib/gems/2.5.0/gems/iruby-0.4.0/lib/iruby/kernel.rb:17:in `initialize'
8: from /var/lib/gems/2.5.0/gems/iruby-0.4.0/lib/iruby/kernel.rb:17:in `new'
7: from /var/lib/gems/2.5.0/gems/iruby-0.4.0/lib/iruby/session.rb:12:in `initialize'
6: from /var/lib/gems/2.5.0/gems/iruby-0.4.0/lib/iruby/session.rb:112:in `create_session_adapter'
5: from /var/lib/gems/2.5.0/gems/iruby-0.4.0/lib/iruby/session_adapter.rb:62:in `select_adapter_class'
4: from /var/lib/gems/2.5.0/gems/iruby-0.4.0/lib/iruby/session_adapter.rb:62:in `each_value'
3: from /var/lib/gems/2.5.0/gems/iruby-0.4.0/lib/iruby/session_adapter.rb:63:in `block in select_adapter_class'
2: from /var/lib/gems/2.5.0/gems/iruby-0.4.0/lib/iruby/session_adapter.rb:7:in `available?'
1: from /var/lib/gems/2.5.0/gems/iruby-0.4.0/lib/iruby/session_adapter/pyzmq_adapter.rb:4:in `load_requirements'
/var/lib/gems/2.5.0/gems/iruby-0.4.0/lib/iruby/session_adapter/pyzmq_adapter.rb:7:in `rescue in load_requirements': uninitialized constant IRuby::SessionAdapter::PyzmqAdapter::PyCall (NameError)
Recommended Posts