Mercurial > sat_docs
annotate docker/base/Dockerfile @ 130:82b148ed4f98
screenshort (0.7): added file sharing animation
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 05 Jul 2018 14:14:58 +0200 |
parents | 5d2eb2f61dc8 |
children |
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 | |
119
5d2eb2f61dc8
docker (base): Twisted and Wokkel are now installed with pip instead of apt, as Jessie version is too old for SàT
Goffi <goffi@goffi.org>
parents:
117
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-xdg python-xe python-zope.interface python-gi python-urwid python-markdown python-html2text mercurial python-pip python-openssl python-service-identity gcc python-dev && \ |
5d2eb2f61dc8
docker (base): Twisted and Wokkel are now installed with pip instead of apt, as Jessie version is too old for SàT
Goffi <goffi@goffi.org>
parents:
117
diff
changeset
|
46 |
5d2eb2f61dc8
docker (base): Twisted and Wokkel are now installed with pip instead of apt, as Jessie version is too old for SàT
Goffi <goffi@goffi.org>
parents:
117
diff
changeset
|
47 # we install Twisted from pip as Jessie version is too old |
5d2eb2f61dc8
docker (base): Twisted and Wokkel are now installed with pip instead of apt, as Jessie version is too old for SàT
Goffi <goffi@goffi.org>
parents:
117
diff
changeset
|
48 pip install twisted wokkel pyOpenSSL && \ |
5d2eb2f61dc8
docker (base): Twisted and Wokkel are now installed with pip instead of apt, as Jessie version is too old for SàT
Goffi <goffi@goffi.org>
parents:
117
diff
changeset
|
49 |
5d2eb2f61dc8
docker (base): Twisted and Wokkel are now installed with pip instead of apt, as Jessie version is too old for SàT
Goffi <goffi@goffi.org>
parents:
117
diff
changeset
|
50 # we remove stuff only needed to build Twisted |
5d2eb2f61dc8
docker (base): Twisted and Wokkel are now installed with pip instead of apt, as Jessie version is too old for SàT
Goffi <goffi@goffi.org>
parents:
117
diff
changeset
|
51 # and clean what we can |
5d2eb2f61dc8
docker (base): Twisted and Wokkel are now installed with pip instead of apt, as Jessie version is too old for SàT
Goffi <goffi@goffi.org>
parents:
117
diff
changeset
|
52 apt-get purge -y gcc python-dev && \ |
5d2eb2f61dc8
docker (base): Twisted and Wokkel are now installed with pip instead of apt, as Jessie version is too old for SàT
Goffi <goffi@goffi.org>
parents:
117
diff
changeset
|
53 apt-get autoremove -y && 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
|
54 |
94
eeff161a19e8
docker (base): add dokuwiki module for dokuwiki importer + fixed /etc/hosts for subdomains
Goffi <goffi@goffi.org>
parents:
84
diff
changeset
|
55 # dokuwiki module is needed for the blog importer |
105 | 56 pip install dokuwiki && \ |
57 | |
58 # we need a TCP socket for D-Bus | |
59 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
|
60 |
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
|
61 # we need UTF-8 locale |
105 | 62 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
|
63 |
105 | 64 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
|
65 |
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
|
66 ################ |
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
|
67 # 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
|
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 |
105 | 70 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
|
71 |
105 | 72 hg clone https://repos.goffi.org/urwid-satext && cd urwid-satext && \ |
73 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
|
74 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
|
75 |
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
|
76 ##################### |
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
|
77 # 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
|
78 ##################### |
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 |
105 | 80 hg clone https://repos.goffi.org/sat && cd sat && \ |
81 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
|
82 # we save repository data so SàT can get repository version |
105 | 83 # 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
|
84 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 | 85 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
|
86 |
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 ###################### |
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
|
88 # 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
|
89 ###################### |
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
|
90 |
83
8dd32aa49614
docker: pid files are put in /tmp to avoid conflict when restarting a container
Goffi <goffi@goffi.org>
parents:
80
diff
changeset
|
91 # we want .pid files in /tmp so they are removed if container are deleted |
105 | 92 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
|
93 # 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
|
94 # 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
|
95 [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
|
96 |
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
|
97 # 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
|
98 # 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
|
99 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
|
100 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
|
101 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
|
102 |
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
|
103 ########## |
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
|
104 # 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
|
105 ########## |
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
|
106 |
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
|
107 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
|
108 |
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
|
109 ENTRYPOINT ["/bin/bash"] |