diff docker/libervia/Dockerfile @ 80:686a8c982c3f

docker: updated Dockerfiles: - use HTTPS URLs instead of HTTP - prosody image know use prosody Debian repository instead of Debian Jessie version, prosody 0.10 is used - prosody configuration is now in prosody directory next to Dockerfile, instead of using difficult to maintain sed calls - community modules are downloaded from mercurial, and only needed ones are kept - no more remote-roster hack \o/ - pubsub component is not at pubsub.[domain] (was sat-pubsub before) - SàT media are gotten from hg instead of ftp, so they are up-to-date with SàT version - libervia image now use pip for txJSON-RPC - fixed now needed jinja2 installation - fixed libervia/admin accounts auto-creation script - fixed uid/gid for prosody in data image - removed not needed anymore nox option in base image - added python-pip in base image - docker images now work with current dev version (0.6.0D)
author Goffi <goffi@goffi.org>
date Fri, 12 Feb 2016 20:24:24 +0100
parents b27e7f9ad479
children bcba1966e6db
line wrap: on
line diff
--- a/docker/libervia/Dockerfile	Wed Feb 10 18:22:56 2016 +0100
+++ b/docker/libervia/Dockerfile	Fri Feb 12 20:24:24 2016 +0100
@@ -14,17 +14,7 @@
 # txJSON-RPC #
 ##############
 
-WORKDIR /tmp/txjsonrpc
-
-# wget and tar are not installed, so we use python
-RUN python -c 'import urllib2,tarfile,cStringIO;tar=tarfile.open(fileobj=cStringIO.StringIO(urllib2.urlopen("https://pypi.python.org/packages/source/t/txJSON-RPC/txJSON-RPC-0.3.1.tar.gz").read()));tar.extractall()'
-
-# we don't need setuptools, so we just install through python
-RUN cd tx*; sed -i "s/from setuptools/from distutils.core/" setup.py; python setup.py install
-
-WORKDIR /tmp
-
-RUN rm -rf txjsonrpc
+RUN pip install txJSON-RPC
 
 ###########
 # PYJAMAS #
@@ -33,7 +23,7 @@
 WORKDIR /usr/share
 
 # as the situation with pyjamas is complicated, we get the archive from our own ftp
-RUN python -c 'import urllib2,tarfile,cStringIO;tar=tarfile.open(fileobj=cStringIO.StringIO(urllib2.urlopen("http://ftp.goffi.org/pyjamas/pyjamas.tar.bz2").read()));tar.extractall()'
+RUN python -c 'import urllib2,tarfile,cStringIO;tar=tarfile.open(fileobj=cStringIO.StringIO(urllib2.urlopen("https://ftp.goffi.org/pyjamas/pyjamas.tar.bz2").read()));tar.extractall()'
 
 WORKDIR pyjamas
 
@@ -47,7 +37,9 @@
 
 WORKDIR /tmp
 
-RUN hg clone http://repos.goffi.org/libervia
+RUN apt-get install -y --no-install-recommends python-jinja2
+
+RUN hg clone https://repos.goffi.org/libervia
 
 WORKDIR libervia
 
@@ -76,7 +68,9 @@
 sat.getReady()\n\
 admin_email = sat.getConfig(account.CONFIG_SECTION, "admin_email") or account.default_conf["admin_email"]\n\
 for profile in ["libervia", "admin"]:\n\
-    if not sat.getProfileName(profile):\n\
+    try:\n\
+        sat.getProfileName(profile)\n\
+    except Exception as e:\n\
         print "{} profile doesn'\''t exists, creating it".format(profile)\n\
         print "registering {}@{}".format(profile, sat.getNewAccountDomain())\n\
         pwd = generate_pwd()\n\
@@ -84,7 +78,7 @@
             config.fixConfigOption("libervia", "passphrase", pwd)\n\
         elif profile == "admin":\n\
             with open("/home/sat/ADMIN_PWD", "w") as f:\n\
-                f.write("%s\n" % pwd)\n\
+                f.write("%s\\n" % pwd)\n\
         sat.registerSatAccount(admin_email, pwd, profile)\n\
 os.execvp("libervia", ["libervia"] + sys.argv[1:])\n\
 ' > /usr/bin/libervia_cont_launch && chmod 555 /usr/bin/libervia_cont_launch