File tree Expand file tree Collapse file tree 3 files changed +64
-3
lines changed Expand file tree Collapse file tree 3 files changed +64
-3
lines changed Original file line number Diff line number Diff line change 1+ FROM opensuse:42.1
2+
3+ MAINTAINER Chu-Siang Lai <chusiang@drx.tw>
4+
5+ # Install the requires package and python.
6+ RUN zypper addrepo -Gf http://download.opensuse.org/repositories/systemsmanagement/openSUSE_Leap_42.1/ systemsmanagement
7+ RUN zypper update -y
8+ RUN zypper install -y \
9+ kernel-devel gcc python python-pip python-devel \
10+ libffi-devel-gcc5 libopenssl-devel libzmq5 \
11+ && \
12+ zypper clean -a
13+
14+ # Install the Ansible 2.0+
15+ RUN zypper install -y ansible-2.2.0.0-56.1
16+
17+ # for disable localhost warning message.
18+ RUN /bin/echo -e "[local]\n localhost ansible_connection=local" > /etc/ansible/hosts
19+
20+ # Upgrade the pip to lastest.
21+ RUN pip install -U pip
22+
23+ # Setup with Ansible.
24+ ADD https://raw.githubusercontent.com/chusiang/ansible-jupyter.dockerfile/master/setup_jupyter.yml /home
25+ RUN ansible-playbook -vvvv /home/setup_jupyter.yml
26+
27+ # Copy a ipython notebook example to image.
28+ ADD https://raw.githubusercontent.com/chusiang/ansible-jupyter.dockerfile/master/ipynb/ansible_on_jupyter.ipynb /home/
29+
30+ # Run service of Jupyter.
31+ COPY docker-entrypoint.sh /usr/local/bin/
32+ ENTRYPOINT [ "docker-entrypoint.sh" ]
33+ EXPOSE 8888
34+
35+ CMD [ "jupyter" , "--version" ]
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ # ============================================================
3+ # Author: Chu-Siang Lai / chusiang (at) drx.tw
4+ # Blog: http://note.drx.tw
5+ # Filename: docker-entrypoint.sh
6+ # Modified: 2016-11-20 18:43
7+ # Description: Run the jupyter service.
8+ #
9+ # --ip 0.0.0.0: Allow all IP access.
10+ # --no-browser: Don't open browser from command line.
11+ # --notebook-dir: Bunding the workdir.
12+ #
13+ # ===========================================================
14+
15+ jupyter-notebook --ip 0.0.0.0 --no-browser --notebook-dir=/home
Original file line number Diff line number Diff line change 2121 yum_packages :
2222 - openssh-clients
2323 - vim-minimal
24-
24+
25+ zypper_packages :
26+ - openssh
27+ - vim
28+
2529 pip_packages :
2630 - docker-py
2731 - docker-compose
5458 - yum_packages is defined
5559 - ansible_pkg_mgr == "yum"
5660
57- - name : install some pip packages
61+ - name : install zypper packages
62+ zypper : name={{ item }} state=latest
63+ with_nested : " {{ zypper_packages }}"
64+ when :
65+ - zypper_packages is defined
66+ - ansible_pkg_mgr == "zypper"
67+
68+ - name : install pip packages
5869 pip : name={{ item }} state=latest
5970 with_nested : " {{ pip_packages }}"
6071 when : pip_packages is defined
6172
62- - name : install the jupyter
73+ - name : install the jupyter notebook
6374 pip : name=jupyter version=1.0.0 state=present
6475
6576# vim:ft=ansible :
You can’t perform that action at this time.
0 commit comments