Skip to content

Commit 4b48e8f

Browse files
committed
Merge branch 'develop'
2 parents e775c36 + bc1f770 commit 4b48e8f

File tree

3 files changed

+78
-16
lines changed

3 files changed

+78
-16
lines changed

README.md

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
1-
# Docker image: Ansible on Jupyter
1+
# Docker image: Ansible on Jupyter Notebook
22

3-
A Docker image for run Ansible 2.2 on Jupyter 4.2 (ipython notebook).
3+
A Docker image for run [Ansible][ansible_offical] 2.2 on [Jupyter Notebook][jupyter_official] 4.2 (ipython notebook) with Browsers.
44

5-
- `alpine-3.4`, `latest` ([alpine/Dockerfile
6-
](https://github.com/chusiang/ansible-jupyter.dockerfile/blob/master/alpine/Dockerfile))
7-
- `debian-8` ([debian-8/Dockerfile
8-
](https://github.com/chusiang/ansible-jupyter.dockerfile/blob/master/debian-8/Dockerfile))
9-
- `ubuntu-14.04` ([ubuntu-14.04/Dockerfile
10-
](https://github.com/chusiang/ansible-jupyter.dockerfile/blob/master/ubuntu-14.04/Dockerfile))
11-
- `ubuntu-16.04` ([ubuntu-16.04/Dockerfile
12-
](https://github.com/chusiang/ansible-jupyter.dockerfile/blob/master/ubuntu-16.04/Dockerfile))
5+
[ansible_offical]: https://www.ansible.com/
6+
[jupyter_official]: http://jupyter.org/
7+
8+
- `alpine-3.4`, `latest` ([alpine/Dockerfile][dockerfile_alpine])
9+
- `debian-7` ([debian-7/Dockerfile][dockerfile_debian-7])
10+
- `debian-8` ([debian-8/Dockerfile][dockerfile_debian-8])
11+
- `ubuntu-14.04` ([ubuntu-14.04/Dockerfile][dockerfile_ubuntu-14.04])
12+
- `ubuntu-16.04` ([ubuntu-16.04/Dockerfile][dockerfile_ubuntu-16.04])
13+
14+
[dockerfile_alpine]: https://github.com/chusiang/ansible-jupyter.dockerfile/blob/master/alpine/Dockerfile
15+
[dockerfile_debian-7]: https://github.com/chusiang/ansible-jupyter.dockerfile/blob/master/debian-7/Dockerfile
16+
[dockerfile_debian-8]: https://github.com/chusiang/ansible-jupyter.dockerfile/blob/master/debian-8/Dockerfile
17+
[dockerfile_ubuntu-14.04]: https://github.com/chusiang/ansible-jupyter.dockerfile/blob/master/ubuntu-14.04/Dockerfile
18+
[dockerfile_ubuntu-16.04]: https://github.com/chusiang/ansible-jupyter.dockerfile/blob/master/ubuntu-16.04/Dockerfile
1319

1420
## Build image
1521

@@ -75,14 +81,19 @@ Now, you can play the Ansible on Jupyter.
7581
$ open http://localhost:32786
7682
```
7783
78-
![2016-11-20-ansible-jupyter1](https://cloud.githubusercontent.com/assets/219066/20463322/218f0c4a-af6b-11e6-9a95-2411ec7acb5f.png)
84+
![2016-11-20-ansible-jupyter1]
85+
86+
[2016-11-20-ansible-jupyter1]: https://cloud.githubusercontent.com/assets/219066/20463322/218f0c4a-af6b-11e6-9a95-2411ec7acb5f.png
87+
88+
1. Attach my example ==> [`ansible_on_jupyter.ipynb`][ansible_on_jupyter.ipynb].
7989
90+
[ansible_on_jupyter.ipynb]: https://github.com/chusiang/ansible-jupyter.dockerfile/blob/master/ipynb/ansible_on_jupyter.ipynb
8091
81-
1. Attach my example ==> [`ansible_on_jupyter.ipynb`
82-
](https://github.com/chusiang/ansible-jupyter.dockerfile/blob/master/ipynb/ansible_on_jupyter.ipynb).
92+
![2016-11-20-ansible-jupyter2]
8393
84-
![2016-11-20-ansible-jupyter](https://cloud.githubusercontent.com/assets/219066/20463319/fa8c047c-af6a-11e6-96d6-f985096c9c8c.png)
94+
[2016-11-20-ansible-jupyter2]: https://cloud.githubusercontent.com/assets/219066/20463319/fa8c047c-af6a-11e6-96d6-f985096c9c8c.png
8595
86-
1. Remember use the `!` prefix to trigger command.
96+
1. Remember use the `!` prefix to trigger system command.
8797
88-
Enjoy it !
98+
Enjoy it !
99+
I

debian-7/Dockerfile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
FROM debian:7
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-amd64 gcc build-essential python python-pip python-dev \
10+
libffi-dev libssl-dev \
11+
&& \
12+
apt-get clean
13+
14+
# Upgrade the pip to lastest.
15+
RUN pip install -U pip
16+
17+
# Setup the ansible.
18+
RUN pip install ansible
19+
20+
# for disable localhost warning message.
21+
RUN mkdir /etc/ansible && \
22+
/bin/echo -e "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts
23+
24+
# Setup with Ansible.
25+
ADD https://raw.githubusercontent.com/chusiang/ansible-jupyter.dockerfile/master/setup_jupyter.yml /home
26+
RUN ansible-playbook -vvvv /home/setup_jupyter.yml
27+
28+
# Copy a ipython notebook example to image.
29+
ADD https://raw.githubusercontent.com/chusiang/ansible-jupyter.dockerfile/master/ipynb/ansible_on_jupyter.ipynb /home/
30+
31+
# Run service of Jupyter.
32+
COPY docker-entrypoint.sh /usr/local/bin/
33+
ENTRYPOINT [ "docker-entrypoint.sh" ]
34+
EXPOSE 8888
35+
36+
CMD [ "jupyter", "--version" ]

debian-7/docker-entrypoint.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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

0 commit comments

Comments
 (0)