annotate docker/base/Dockerfile @ 117:834bedf42332

docker (base): create sat.conf in ~sat/.config/sat with right permissions so it is not created by set_account_domain
author Goffi <goffi@goffi.org>
date Tue, 08 Mar 2016 13:52:11 +0100
parents 8b228fd053bc
children 5d2eb2f61dc8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
21
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
1 ###############################################################
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
2 # #
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
3 # Salut à Toi/base #
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
4 # This Dockerfile build a « Salut à Toi » base image #
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
5 # Salut à Toi is a multi-frontends multi-purposes XMPP client #
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
6 # #
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
7 ###############################################################
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
8
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
9 FROM debian:jessie
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
10
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
11 MAINTAINER Goffi <goffi@goffi.org>
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
12
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
13 ########
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
14 # BASE #
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
15 ########
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
16
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
17 ENV DEBIAN_FRONTEND noninteractive
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
18
105
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
19 ## Helping scripts ##
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
20 # Following scripts make the configuration as automatic and easy as possible
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
21 COPY scripts/set_account_domain scripts/sat scripts/add_host scripts/dbus_wrap scripts/prosodyctl /usr/local/bin/
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
22
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
23 RUN chown root:root /usr/local/bin/set_account_domain && \
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
24 chmod 0555 /usr/local/bin/set_account_domain && \
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
25 chown root:root /usr/local/bin/sat && \
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
26 chmod 0500 /usr/local/bin/sat && \
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
27 chown root:root /usr/local/bin/add_host && \
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
28 chmod 0555 /usr/local/bin/add_host && \
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
29 chown root:root /usr/local/bin/prosodyctl && \
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
30 chmod 0555 /usr/local/bin/prosodyctl && \
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
31 chown root:root /usr/local/bin/dbus_wrap && \
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
32 chmod 0555 /usr/local/bin/dbus_wrap && \
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
33
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
34 # it's better to have a dedicated user
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
35 useradd -m sat && \
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
36
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
37 # will be used to put many SàT specific data
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
38 mkdir -p /usr/share/sat && \
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
39 mkdir /usr/share/sat/certificates && \
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
40 addgroup tls-cert --gid 9999 && \
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
41 chown :tls-cert /usr/share/sat/certificates && \
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
42 chmod 2770 /usr/share/sat/certificates && \
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
43 adduser sat tls-cert
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
44
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
45 RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends locales dbus-x11 python python-gobject-2 python-dbus python-lxml python-mutagen python-pil python-crypto python-feed python-potr python-twisted-core python-twisted-mail python-twisted-web python-twisted-words python-wokkel python-xdg python-xe python-zope.interface python-gi python-urwid python-markdown python-html2text mercurial python-pip && apt-get clean && \
21
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
46
94
eeff161a19e8 docker (base): add dokuwiki module for dokuwiki importer + fixed /etc/hosts for subdomains
Goffi <goffi@goffi.org>
parents: 84
diff changeset
47 # dokuwiki module is needed for the blog importer
105
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
48
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
49 pip install dokuwiki && \
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
50
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
51 # we need a TCP socket for D-Bus
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
52 sed -i "s&<listen>unix:tmpdir=/tmp</listen>&\0\n <listen>tcp:host=localhost,bind=*,port=55555,family=ipv4</listen>\n <auth>ANONYMOUS</auth>\n <allow_anonymous/>&" /etc/dbus-1/session.conf && \
94
eeff161a19e8 docker (base): add dokuwiki module for dokuwiki importer + fixed /etc/hosts for subdomains
Goffi <goffi@goffi.org>
parents: 84
diff changeset
53
21
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
54 # we need UTF-8 locale
105
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
55 sed -i "s/# en_US.UTF-8/en_US.UTF-8/" /etc/locale.gen && locale-gen
21
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
56
105
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
57 ENV LC_ALL en_US.UTF-8
21
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
58
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
59 ################
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
60 # URWID SÀTEXT #
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
61 ################
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
62
105
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
63 RUN cd /tmp && \
21
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
64
105
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
65 hg clone https://repos.goffi.org/urwid-satext && cd urwid-satext && \
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
66 python setup.py install --prefix /usr --install-lib /usr/lib/python2.7/dist-packages && \
106
8b228fd053bc docker (base, libervia): use new getRepositoryData ability to save data in a .hg_data file
Goffi <goffi@goffi.org>
parents: 105
diff changeset
67 cd /tmp && rm -rf urwid-satext && \
21
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
68
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
69 #####################
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
70 # CORE INSTALLATION #
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
71 #####################
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
72
105
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
73 hg clone https://repos.goffi.org/sat && cd sat && \
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
74 python setup.py install --prefix /usr --install-lib /usr/lib/python2.7/dist-packages && \
106
8b228fd053bc docker (base, libervia): use new getRepositoryData ability to save data in a .hg_data file
Goffi <goffi@goffi.org>
parents: 105
diff changeset
75 # we save repository data so SàT can get repository version
105
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
76 # TODO: should be done in setup.py in the future
106
8b228fd053bc docker (base, libervia): use new getRepositoryData ability to save data in a .hg_data file
Goffi <goffi@goffi.org>
parents: 105
diff changeset
77 python -c 'from sat.tools import utils;utils.getRepositoryData("/tmp/sat", is_path=True, save_dir_path="/usr/lib/python2.7/dist-packages/sat")' && \
105
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
78 cd /tmp && rm -rf sat && \
21
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
79
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
80 ######################
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
81 # SàT CONFIGURATION #
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
82 ######################
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
83
83
8dd32aa49614 docker: pid files are put in /tmp to avoid conflict when restarting a container
Goffi <goffi@goffi.org>
parents: 80
diff changeset
84 # we want .pid files in /tmp so they are removed if container are deleted
105
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
85 echo '[DEFAULT]\npid_dir=/tmp\n\n\
21
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
86 # we auto-create libervia account if it doesn't exists in Libervia container
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
87 # so we remove it from reserved_list in plugin account
117
834bedf42332 docker (base): create sat.conf in ~sat/.config/sat with right permissions so it is not created by set_account_domain
Goffi <goffi@goffi.org>
parents: 106
diff changeset
88 [plugin account]\nreserved_list=' >> /etc/sat.conf && \
834bedf42332 docker (base): create sat.conf in ~sat/.config/sat with right permissions so it is not created by set_account_domain
Goffi <goffi@goffi.org>
parents: 106
diff changeset
89
834bedf42332 docker (base): create sat.conf in ~sat/.config/sat with right permissions so it is not created by set_account_domain
Goffi <goffi@goffi.org>
parents: 106
diff changeset
90 # we create a sat.conf in sat user's XDG directory
834bedf42332 docker (base): create sat.conf in ~sat/.config/sat with right permissions so it is not created by set_account_domain
Goffi <goffi@goffi.org>
parents: 106
diff changeset
91 # else it would be created by set_account_domain with root only permissions
834bedf42332 docker (base): create sat.conf in ~sat/.config/sat with right permissions so it is not created by set_account_domain
Goffi <goffi@goffi.org>
parents: 106
diff changeset
92 mkdir -p /home/sat/.config/sat && touch /home/sat/.config/sat/sat.conf && \
834bedf42332 docker (base): create sat.conf in ~sat/.config/sat with right permissions so it is not created by set_account_domain
Goffi <goffi@goffi.org>
parents: 106
diff changeset
93 chown -R sat:sat /home/sat/.config && chmod 0700 /home/sat/.config/sat && \
834bedf42332 docker (base): create sat.conf in ~sat/.config/sat with right permissions so it is not created by set_account_domain
Goffi <goffi@goffi.org>
parents: 106
diff changeset
94 chmod 0600 /home/sat/.config/sat/sat.conf
21
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
95
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
96 ##########
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
97 # LAUNCH #
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
98 ##########
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
99
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
100 WORKDIR /home/sat
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
101
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
102 ENTRYPOINT ["/bin/bash"]