From c11f44308b36aa445783ba4776c6d55a4d7a214a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Roberto=20Meza=20Cabrera?= Date: Fri, 8 Nov 2019 15:11:26 -0600 Subject: [PATCH 1/3] Added git and app user to Dockerfile --- .gitignore | 1 + Dockerfile | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 341e568..0f194eb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /.vagrant /versions +/.docker diff --git a/Dockerfile b/Dockerfile index 820bab9..5fdf591 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,6 +6,8 @@ RUN . /etc/os-release && \ apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F23C5A6CF475977595C89F51BA6932366A755776 && \ apt-get update && \ apt-get install -y \ + git \ + \ python-pip \ python3-pip \ \ @@ -17,4 +19,9 @@ RUN . /etc/os-release && \ && \ pip3 install tox virtualenv && \ apt-get --purge autoremove -y gnupg && \ - rm -rf /var/cache/apt/lists + rm -rf /var/cache/apt/lists && \ + useradd -rm -d /home/app -s /bin/bash -g root -G sudo -u 1000 app + +USER app + +WORKDIR /app From b133d1730c7c0bb768668ff42e6c3178d68e86f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Roberto=20Meza=20Cabrera?= Date: Sun, 10 Nov 2019 11:22:50 -0600 Subject: [PATCH 2/3] Test with supported Python versions only --- Dockerfile | 14 ++++++++------ Makefile | 4 ++-- README.md | 11 +---------- 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5fdf591..892a26a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,14 +8,16 @@ RUN . /etc/os-release && \ apt-get install -y \ git \ \ - python-pip \ python3-pip \ \ - python2.? \ - python2.?-dev \ - python3.? \ - python3.?-dev \ - python3.?-venv \ + python3.5 \ + python3.5-dev \ + python3.6 \ + python3.6-dev \ + python3.7 \ + python3.7-dev \ + python3.8 \ + python3.8-dev \ && \ pip3 install tox virtualenv && \ apt-get --purge autoremove -y gnupg && \ diff --git a/Makefile b/Makefile index bf6ff51..5004145 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -TAG := fkrull/multi-python +TAG := massware/multi-python3 all: image versions-file @@ -6,4 +6,4 @@ image: docker build -t $(TAG) . versions-file: - docker run --rm $(TAG) dpkg-query --show python2.? python3.? > versions + docker run --rm $(TAG) dpkg-query --show python3.? > versions diff --git a/README.md b/README.md index 259629c..fce400c 100644 --- a/README.md +++ b/README.md @@ -5,18 +5,9 @@ This is a Docker image that has many different Python versions pre-installed. It ## Details The image is based on Ubuntu 18.04. Python packages come from [the Deadsnakes PPA](https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa). The following Python runtimes are installed: -* Python 2.3 -* Python 2.4 -* Python 2.5 -* Python 2.6 -* Python 2.7 -* Python 3.1 -* Python 3.2 -* Python 3.3 -* Python 3.4 * Python 3.5 * Python 3.6 * Python 3.7 * Python 3.8 -This includes the header packages (`pythonx.y-dev`) and venv where applicable. In addition, tox and virtualenv are pre-installed. +This includes the header packages (`python3.{5-8}-dev`) and venv where applicable. In addition, tox and virtualenv are pre-installed. From e4e635bbc32144f8b6dbf3980d743ca072d15b07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Roberto=20Meza=20Cabrera?= Date: Thu, 19 Dec 2019 23:54:11 -0600 Subject: [PATCH 3/3] Add support for psql databases and improve makefile to publish image --- Dockerfile | 7 ++++--- Makefile | 9 ++++----- README.md | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 892a26a..6ca0c37 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,9 +17,10 @@ RUN . /etc/os-release && \ python3.7 \ python3.7-dev \ python3.8 \ - python3.8-dev \ - && \ - pip3 install tox virtualenv && \ + python3.8-dev + +RUN apt-get install -y libpq-dev && \ + python3.7 -m pip install tox virtualenv pytest && \ apt-get --purge autoremove -y gnupg && \ rm -rf /var/cache/apt/lists && \ useradd -rm -d /home/app -s /bin/bash -g root -G sudo -u 1000 app diff --git a/Makefile b/Makefile index 5004145..660034d 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,8 @@ TAG := massware/multi-python3 -all: image versions-file - -image: +build: docker build -t $(TAG) . -versions-file: - docker run --rm $(TAG) dpkg-query --show python3.? > versions +push: + $(MAKE) build + docker --config .docker push $(TAG):latest diff --git a/README.md b/README.md index fce400c..1818a8a 100644 --- a/README.md +++ b/README.md @@ -10,4 +10,4 @@ The image is based on Ubuntu 18.04. Python packages come from [the Deadsnakes PP * Python 3.7 * Python 3.8 -This includes the header packages (`python3.{5-8}-dev`) and venv where applicable. In addition, tox and virtualenv are pre-installed. +This includes the header packages (`python3.{5-8}-dev`) and venv where applicable, psql client. In addition, tox and virtualenv are pre-installed.