diff options
author | Jan Christian Grünhage <jan.christian@gruenhage.xyz> | 2018-09-19 13:48:41 +0200 |
---|---|---|
committer | Jan Christian Grünhage <jan.christian@gruenhage.xyz> | 2018-09-20 14:55:11 +0200 |
commit | 8dfb33d325a7b231668973338894d08f0d5436c9 (patch) | |
tree | eeea8a36b786ebdd1a0564c5719f3035eb052571 /docker | |
parent | Merge pull request #3868 from matrix-org/neilj/fix_room_invite_mail_links (diff) | |
download | synapse-8dfb33d325a7b231668973338894d08f0d5436c9.tar.xz |
make python 3 work in the docker container
Diffstat (limited to 'docker')
-rw-r--r-- | docker/Dockerfile | 4 | ||||
-rwxr-xr-x | docker/start.py | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/docker/Dockerfile b/docker/Dockerfile index 20d3fe3bd8..ad0ae0b734 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,5 @@ -FROM docker.io/python:2-alpine3.8 +ARG PYTHON_VERSION=2 +FROM docker.io/python:${PYTHON_VERSION}-alpine3.8 COPY . /synapse @@ -12,6 +13,7 @@ RUN apk add --no-cache --virtual .build_deps \ postgresql-dev \ zlib-dev \ && cd /synapse \ + && sed -i 's/\["synctl"\] + //' setup.py \ && apk add --no-cache --virtual .runtime_deps \ libffi \ libjpeg-turbo \ diff --git a/docker/start.py b/docker/start.py index 90e8b9c51a..346df8c87f 100755 --- a/docker/start.py +++ b/docker/start.py @@ -5,6 +5,7 @@ import os import sys import subprocess import glob +import codecs # Utility functions convert = lambda src, dst, environ: open(dst, "w").write(jinja2.Template(open(src).read()).render(**environ)) @@ -23,7 +24,7 @@ def generate_secrets(environ, secrets): with open(filename) as handle: value = handle.read() else: print("Generating a random secret for {}".format(name)) - value = os.urandom(32).encode("hex") + value = codecs.encode(os.urandom(32), "hex").decode() with open(filename, "w") as handle: handle.write(value) environ[secret] = value |