annotate docker/base/Dockerfile @ 150:10adfa3f9552

flatpak (build_manifest): icon names depends of app_id, so set cache to be dependant of app_id
author Goffi <goffi@goffi.org>
date Wed, 26 Jun 2019 20:46:53 +0200
parents 5d2eb2f61dc8
children
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
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
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
56 pip install dokuwiki && \
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
57
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
58 # we need a TCP socket for D-Bus
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
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 && \
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
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
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
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
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
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
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
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
72 hg clone https://repos.goffi.org/urwid-satext && cd urwid-satext && \
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
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
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
80 hg clone https://repos.goffi.org/sat && cd sat && \
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
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
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
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
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
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
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 97
diff changeset
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"]