annotate docker_legacy/base/Dockerfile @ 175:73053fcc74c2

association: ajout du compte rendu de l'AG extraordinaire du 30 octobre 2021
author Goffi <goffi@goffi.org>
date Thu, 02 Dec 2021 21:21:36 +0100
parents 29873a41aae1
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
164
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
1 ###############################################################
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
2 # #
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
3 # Salut à Toi/base #
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
4 # This Dockerfile build a « Salut à Toi » base image #
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
5 # Salut à Toi is a multi-frontends multi-purposes XMPP client #
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
6 # #
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
7 ###############################################################
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
8
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
9 FROM debian:jessie
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
10
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
11 MAINTAINER Goffi <goffi@goffi.org>
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
12
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
13 ########
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
14 # BASE #
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
15 ########
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
16
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
17 ENV DEBIAN_FRONTEND noninteractive
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
18
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
19 ## Helping scripts ##
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
20 # Following scripts make the configuration as automatic and easy as possible
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
21 COPY scripts/set_account_domain scripts/sat scripts/add_host scripts/dbus_wrap scripts/prosodyctl /usr/local/bin/
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
22
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
23 RUN chown root:root /usr/local/bin/set_account_domain && \
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
24 chmod 0555 /usr/local/bin/set_account_domain && \
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
25 chown root:root /usr/local/bin/sat && \
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
26 chmod 0500 /usr/local/bin/sat && \
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
27 chown root:root /usr/local/bin/add_host && \
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
28 chmod 0555 /usr/local/bin/add_host && \
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
29 chown root:root /usr/local/bin/prosodyctl && \
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
30 chmod 0555 /usr/local/bin/prosodyctl && \
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
31 chown root:root /usr/local/bin/dbus_wrap && \
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
32 chmod 0555 /usr/local/bin/dbus_wrap && \
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
33
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
34 # it's better to have a dedicated user
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
35 useradd -m sat && \
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
36
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
37 # will be used to put many SàT specific data
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
38 mkdir -p /usr/share/sat && \
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
39 mkdir /usr/share/sat/certificates && \
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
40 addgroup tls-cert --gid 9999 && \
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
41 chown :tls-cert /usr/share/sat/certificates && \
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
42 chmod 2770 /usr/share/sat/certificates && \
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
43 adduser sat tls-cert
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
44
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
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 && \
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
46
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
47 # we install Twisted from pip as Jessie version is too old
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
48 pip install twisted wokkel pyOpenSSL && \
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
49
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
50 # we remove stuff only needed to build Twisted
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
51 # and clean what we can
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
52 apt-get purge -y gcc python-dev && \
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
53 apt-get autoremove -y && apt-get clean && \
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
54
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
55 # dokuwiki module is needed for the blog importer
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
56 pip install dokuwiki && \
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
57
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
58 # we need a TCP socket for D-Bus
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
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 && \
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
60
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
61 # we need UTF-8 locale
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
62 sed -i "s/# en_US.UTF-8/en_US.UTF-8/" /etc/locale.gen && locale-gen
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
63
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
64 ENV LC_ALL en_US.UTF-8
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
65
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
66 ################
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
67 # URWID SÀTEXT #
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
68 ################
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
69
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
70 RUN cd /tmp && \
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
71
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
72 hg clone https://repos.goffi.org/urwid-satext && cd urwid-satext && \
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
73 python setup.py install --prefix /usr --install-lib /usr/lib/python2.7/dist-packages && \
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
74 cd /tmp && rm -rf urwid-satext && \
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
75
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
76 #####################
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
77 # CORE INSTALLATION #
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
78 #####################
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
79
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
80 hg clone https://repos.goffi.org/sat && cd sat && \
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
81 python setup.py install --prefix /usr --install-lib /usr/lib/python2.7/dist-packages && \
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
82 # we save repository data so SàT can get repository version
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
83 # TODO: should be done in setup.py in the future
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
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")' && \
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
85 cd /tmp && rm -rf sat && \
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
86
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
87 ######################
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
88 # SàT CONFIGURATION #
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
89 ######################
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
90
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
91 # we want .pid files in /tmp so they are removed if container are deleted
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
92 echo '[DEFAULT]\npid_dir=/tmp\n\n\
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
93 # we auto-create libervia account if it doesn't exists in Libervia container
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
94 # so we remove it from reserved_list in plugin account
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
95 [plugin account]\nreserved_list=' >> /etc/sat.conf && \
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
96
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
97 # we create a sat.conf in sat user's XDG directory
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
98 # else it would be created by set_account_domain with root only permissions
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
99 mkdir -p /home/sat/.config/sat && touch /home/sat/.config/sat/sat.conf && \
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
100 chown -R sat:sat /home/sat/.config && chmod 0700 /home/sat/.config/sat && \
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
101 chmod 0600 /home/sat/.config/sat/sat.conf
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
102
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
103 ##########
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
104 # LAUNCH #
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
105 ##########
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
106
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
107 WORKDIR /home/sat
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
108
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
109 ENTRYPOINT ["/bin/bash"]