Mercurial > sat_docs
comparison docker_legacy/base/Dockerfile @ 164:29873a41aae1
docker: new docker files are now in sat main repos, this one is legacy
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 01 Jan 2021 18:33:52 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
163:a63f6d360326 | 164:29873a41aae1 |
---|---|
1 ############################################################### | |
2 # # | |
3 # Salut à Toi/base # | |
4 # This Dockerfile build a « Salut à Toi » base image # | |
5 # Salut à Toi is a multi-frontends multi-purposes XMPP client # | |
6 # # | |
7 ############################################################### | |
8 | |
9 FROM debian:jessie | |
10 | |
11 MAINTAINER Goffi <goffi@goffi.org> | |
12 | |
13 ######## | |
14 # BASE # | |
15 ######## | |
16 | |
17 ENV DEBIAN_FRONTEND noninteractive | |
18 | |
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-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 && \ | |
46 | |
47 # we install Twisted from pip as Jessie version is too old | |
48 pip install twisted wokkel pyOpenSSL && \ | |
49 | |
50 # we remove stuff only needed to build Twisted | |
51 # and clean what we can | |
52 apt-get purge -y gcc python-dev && \ | |
53 apt-get autoremove -y && apt-get clean && \ | |
54 | |
55 # dokuwiki module is needed for the blog importer | |
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 && \ | |
60 | |
61 # we need UTF-8 locale | |
62 sed -i "s/# en_US.UTF-8/en_US.UTF-8/" /etc/locale.gen && locale-gen | |
63 | |
64 ENV LC_ALL en_US.UTF-8 | |
65 | |
66 ################ | |
67 # URWID SÀTEXT # | |
68 ################ | |
69 | |
70 RUN cd /tmp && \ | |
71 | |
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 && \ | |
74 cd /tmp && rm -rf urwid-satext && \ | |
75 | |
76 ##################### | |
77 # CORE INSTALLATION # | |
78 ##################### | |
79 | |
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 && \ | |
82 # we save repository data so SàT can get repository version | |
83 # TODO: should be done in setup.py in the future | |
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")' && \ | |
85 cd /tmp && rm -rf sat && \ | |
86 | |
87 ###################### | |
88 # SàT CONFIGURATION # | |
89 ###################### | |
90 | |
91 # we want .pid files in /tmp so they are removed if container are deleted | |
92 echo '[DEFAULT]\npid_dir=/tmp\n\n\ | |
93 # we auto-create libervia account if it doesn't exists in Libervia container | |
94 # so we remove it from reserved_list in plugin account | |
95 [plugin account]\nreserved_list=' >> /etc/sat.conf && \ | |
96 | |
97 # we create a sat.conf in sat user's XDG directory | |
98 # else it would be created by set_account_domain with root only permissions | |
99 mkdir -p /home/sat/.config/sat && touch /home/sat/.config/sat/sat.conf && \ | |
100 chown -R sat:sat /home/sat/.config && chmod 0700 /home/sat/.config/sat && \ | |
101 chmod 0600 /home/sat/.config/sat/sat.conf | |
102 | |
103 ########## | |
104 # LAUNCH # | |
105 ########## | |
106 | |
107 WORKDIR /home/sat | |
108 | |
109 ENTRYPOINT ["/bin/bash"] |