Mercurial > sat_docs
annotate docker/base/Dockerfile @ 118:12cb931dbea0
docker (base): fixed bad escaping in add_host script, resulting in domain not put in /etc/hosts
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 08 Mar 2016 17:54:11 +0100 |
parents | 834bedf42332 |
children | 5d2eb2f61dc8 |
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 | 19 ## Helping scripts ## |
20 # Following scripts make the configuration as automatic and easy as possible | |
21 COPY scripts/set_account_domain scripts/sat scripts/add_host scripts/dbus_wrap scripts/prosodyctl /usr/local/bin/ | |
22 | |
23 RUN chown root:root /usr/local/bin/set_account_domain && \ | |
24 chmod 0555 /usr/local/bin/set_account_domain && \ | |
25 chown root:root /usr/local/bin/sat && \ | |
26 chmod 0500 /usr/local/bin/sat && \ | |
27 chown root:root /usr/local/bin/add_host && \ | |
28 chmod 0555 /usr/local/bin/add_host && \ | |
29 chown root:root /usr/local/bin/prosodyctl && \ | |
30 chmod 0555 /usr/local/bin/prosodyctl && \ | |
31 chown root:root /usr/local/bin/dbus_wrap && \ | |
32 chmod 0555 /usr/local/bin/dbus_wrap && \ | |
33 | |
34 # it's better to have a dedicated user | |
35 useradd -m sat && \ | |
36 | |
37 # will be used to put many SàT specific data | |
38 mkdir -p /usr/share/sat && \ | |
39 mkdir /usr/share/sat/certificates && \ | |
40 addgroup tls-cert --gid 9999 && \ | |
41 chown :tls-cert /usr/share/sat/certificates && \ | |
42 chmod 2770 /usr/share/sat/certificates && \ | |
43 adduser sat tls-cert | |
44 | |
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 | 48 |
49 pip install dokuwiki && \ | |
50 | |
51 # we need a TCP socket for D-Bus | |
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 | 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 | 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 | 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 | 65 hg clone https://repos.goffi.org/urwid-satext && cd urwid-satext && \ |
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 | 73 hg clone https://repos.goffi.org/sat && cd sat && \ |
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 | 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 | 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 | 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"] |