[PATCH] Install Python 3.4 in Docker

Daniel Axtens dja at axtens.net
Fri Aug 26 16:55:59 AEST 2016


Currently, we tox test against Python 3.4. Python 3.4 is included
with Ubuntu 14.04, which is supported for several years to come,
so we want to keep supporting it.

However, Python 3.4 isn't included with Ubuntu 16.04, which is
what the Docker image is based on.

We could downgrade the container to 14.04, but then we'd struggle
to get Python 3.5 into the container. Python 3.5 is the most
recent in the Python 3 series, so we should also be supporting it.

Add the apt sources for Trusty and pull in Python 3.4 from there.

Signed-off-by: Daniel Axtens <dja at axtens.net>

---

This is a bit hacky, but I can't think of anything much better.
If I downgrade to 14.04, you'd need to go through something similar
for 3.5. We could download and build from source, but that seems
even worse.
---
 docker/Dockerfile  | 8 ++++++--
 docker/trusty.list | 3 +++
 2 files changed, 9 insertions(+), 2 deletions(-)
 create mode 100644 docker/trusty.list

diff --git a/docker/Dockerfile b/docker/Dockerfile
index ea2a8fc5ab77..77a3a19c4800 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -12,10 +12,14 @@ ENV DEBIAN_FRONTEND noninteractive
 ENV PYTHONUNBUFFERED 1
 
 # System
+# python3.4-minimal libpython3.4-stdlib libpython3.4-minimal \
+# findutils is for python3.4... :/
+COPY docker/trusty.list /etc/apt/sources.list.d/trusty.list
 RUN apt-get update -qq && \
-    apt-get install -y --no-install-recommends \
+    apt-get install -y --no-install-recommends --allow-downgrades \
     python-dev python-pip python-setuptools python-wheel \
-    python3-dev python3-pip python3-setuptools python3-wheel \
+    python3.5-dev python3-pip python3-setuptools python3-wheel \
+    python3.4-dev findutils=4.4.2-7 \
     libmysqlclient-dev mysql-client curl unzip xvfb chromium-chromedriver \
     chromium-browser build-essential && \
     ln -s /usr/lib/chromium-browser/chromedriver /usr/bin/
diff --git a/docker/trusty.list b/docker/trusty.list
new file mode 100644
index 000000000000..8bb92c09a71f
--- /dev/null
+++ b/docker/trusty.list
@@ -0,0 +1,3 @@
+deb http://archive.ubuntu.com/ubuntu/ trusty main
+deb http://archive.ubuntu.com/ubuntu/ trusty-updates main
+deb http://security.ubuntu.com/ubuntu trusty-security main
-- 
2.7.4



More information about the Patchwork mailing list