Skip to content

Commit 10a0fa5

Browse files
committed
add Dockerfile for CentOS 7
1 parent cb50d9e commit 10a0fa5

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

centos-7/Dockerfile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
FROM centos:7
2+
3+
MAINTAINER Chu-Siang Lai <chusiang@drx.tw>
4+
5+
# Install the requires yum package and python.
6+
RUN yum update -y && \
7+
yum install -y epel-release
8+
RUN yum install -y \
9+
kernel-headers gcc python python-pip python-devel \
10+
libffi-devel openssl-devel \
11+
&& \
12+
yum clean all
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" ]

centos-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)