Skip to content

Commit 998dfe8

Browse files
committed
add Dockerfile for archlinux
1 parent dd465ea commit 998dfe8

File tree

3 files changed

+80
-4
lines changed

3 files changed

+80
-4
lines changed

archlinux/Dockerfile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
FROM finalduty/archlinux:daily
2+
3+
MAINTAINER Chu-Siang Lai <chusiang@drx.tw>
4+
5+
# Upgrade the currently installed packages.
6+
RUN pacman -Syu
7+
8+
# Install the requires package and python.
9+
RUN pacman -S --noconfirm linux-headers gcc python python-pip base-devel \
10+
libffi openssl \
11+
&& \
12+
pacman -Scc --noconfirm
13+
14+
# Upgrade the pip to lastest.
15+
RUN pip install -U pip
16+
17+
# Setup the ansible.
18+
RUN pacman -S --noconfirm ansible && \
19+
pacman -Scc --noconfirm
20+
21+
# for disable localhost warning message.
22+
RUN /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+
ADD setup_jupyter.yml /home
27+
RUN ansible-playbook -vvvv /home/setup_jupyter.yml
28+
29+
# Copy a ipython notebook example to image.
30+
ADD https://raw.githubusercontent.com/chusiang/ansible-jupyter.dockerfile/master/ipynb/ansible_on_jupyter.ipynb /home/
31+
32+
# Run service of Jupyter.
33+
COPY docker-entrypoint.sh /usr/local/bin/
34+
ENTRYPOINT [ "docker-entrypoint.sh" ]
35+
EXPOSE 8888
36+
37+
CMD [ "jupyter", "--version" ]

archlinux/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

setup_jupyter.yml

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- hosts: localhost
55

66
vars:
7+
# Linux.
78
some_packages:
89
- bash
910
- bash-completion
@@ -12,64 +13,87 @@
1213
- git
1314
- openssl
1415

16+
# Alpine.
1517
apk_packages:
1618
- openssh-client
1719
- vim
1820

21+
# Debian, Ubuntu.
1922
apt_packages: "{{ apk_packages }}"
2023

24+
# Arch Linux.
25+
pacman_packages:
26+
- openssh
27+
- vim
28+
29+
# CentOS.
2130
yum_packages:
2231
- openssh-clients
2332
- vim-minimal
2433

25-
zypper_packages:
26-
- openssh
27-
- vim
34+
# openSUSE
35+
zypper_packages: "{{ pacman_packages }}"
2836

37+
# Python.
2938
pip_packages:
3039
- docker-py
3140
- docker-compose
3241

3342
tasks:
43+
# General Linux.
3444
- name: install some packages
3545
package: name={{ item }} state=latest
3646
with_nested: "{{ some_packages }}"
3747
when:
3848
- some_packages is defined
3949

50+
# Alpine.
4051
- name: install apk packages
4152
apk: name={{ item }} state=latest
4253
with_nested: "{{ apk_packages }}"
4354
when:
4455
- apk_packages is defined
4556
- ansible_pkg_mgr == "apk"
4657

58+
# Debian, Ubuntu.
4759
- name: install apt packages
4860
apt: name={{ item }} state=latest
4961
with_nested: "{{ apt_packages }}"
5062
when:
5163
- apt_packages is defined
5264
- ansible_pkg_mgr == "apt"
5365

66+
# Arch Linux.
67+
- name: install pacman packages
68+
pacman: name={{ item }} state=latest
69+
with_nested: "{{ pacman_packages }}"
70+
when:
71+
- pacman_packages is defined
72+
- ansible_pkg_mgr == "pacman"
73+
74+
# CentOS.
5475
- name: install yum packages
5576
yum: name={{ item }} state=latest
5677
with_nested: "{{ yum_packages }}"
5778
when:
5879
- yum_packages is defined
5980
- ansible_pkg_mgr == "yum"
6081

82+
# openSUSE
6183
- name: install zypper packages
6284
zypper: name={{ item }} state=latest
6385
with_nested: "{{ zypper_packages }}"
6486
when:
6587
- zypper_packages is defined
6688
- ansible_pkg_mgr == "zypper"
6789

68-
- name: install pip packages
90+
# General Python packages.
91+
- name: install some pip packages
6992
pip: name={{ item }} state=latest
7093
with_nested: "{{ pip_packages }}"
7194
when: pip_packages is defined
7295

96+
# Only install Jupyter.
7397
- name: install the jupyter notebook
7498
pip: name=jupyter version=1.0.0 state=present
7599

0 commit comments

Comments
 (0)