File tree Expand file tree Collapse file tree 3 files changed +61
-10
lines changed
Expand file tree Collapse file tree 3 files changed +61
-10
lines changed Original file line number Diff line number Diff line change 11# Docker image: Ansible on Jupyter
22
3- A Docker image for run Ansible on Jupyter (ipython notebook).
3+ A Docker image for run Ansible 2.2 on Jupyter 4.2 (ipython notebook).
44
55- ` alpine-3.4 ` , ` latest ` ([ alpine/Dockerfile
66] ( https://github.com/chusiang/ansible-jupyter.dockerfile/blob/master/alpine/Dockerfile ) )
7- - Ansible: ** 2.2.0.0**
8- - Jupyter: ** 4.2.0**
9- - Python: ** 2.7.12**
10- - pip: ** 9.0.1**
11-
127- ` ubuntu-14.04 ` ([ ubuntu-14.04/Dockerfile
138] ( https://github.com/chusiang/ansible-jupyter.dockerfile/blob/master/ubuntu-14.04/Dockerfile ) )
14- - Ansible: ** 2.2.0.0**
15- - Jupyter: ** 4.2.0**
16- - Python: ** 2.7.6**
17- - pip: ** 9.0.1**
9+ - ` ubuntu-16.04 ` ([ ubuntu-16.04/Dockerfile
10+ ] ( https://github.com/chusiang/ansible-jupyter.dockerfile/blob/master/ubuntu-16.04/Dockerfile ) )
1811
1912## Build image
2013
Original file line number Diff line number Diff line change 1+ FROM ubuntu:16.04
2+
3+ MAINTAINER Chu-Siang Lai <chusiang@drx.tw>
4+
5+ # Install the requires apt package and python.
6+ RUN apt-get update
7+
8+ RUN apt-get install -y --no-install-recommends \
9+ linux-headers-generic gcc build-essential python python-pip python-dev \
10+ libffi-dev \
11+ && \
12+ apt-get clean
13+
14+ # Setup the ansible.
15+ RUN apt-get install -y --no-install-recommends \
16+ python-software-properties software-properties-common
17+
18+ RUN add-apt-repository ppa:ansible/ansible -y && apt-get update
19+
20+ RUN apt-get install -y --no-install-recommends \
21+ ansible \
22+ && \
23+ apt-get clean
24+
25+ # for disable localhost warning message.
26+ RUN /bin/echo -e "[local]\n localhost ansible_connection=local" > /etc/ansible/hosts
27+
28+ # Upgrade the pip to lastest.
29+ RUN pip install -U pip
30+
31+ # Setup with Ansible.
32+ ADD https://raw.githubusercontent.com/chusiang/ansible-jupyter.dockerfile/master/setup_jupyter.yml /home
33+ RUN ansible-playbook -vvvv /home/setup_jupyter.yml
34+
35+ # Copy a ipython notebook example to image.
36+ ADD https://raw.githubusercontent.com/chusiang/ansible-jupyter.dockerfile/master/ipynb/ansible_on_jupyter.ipynb /home/
37+
38+ # Run service of Jupyter.
39+ COPY docker-entrypoint.sh /usr/local/bin/
40+ ENTRYPOINT [ "docker-entrypoint.sh" ]
41+ EXPOSE 8888
42+
43+ 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
You can’t perform that action at this time.
0 commit comments