From b2a8a388e2bb0fef47a4d2cb7a8b7148575763d0 Mon Sep 17 00:00:00 2001 From: Felix Krull Date: Wed, 15 Apr 2020 19:08:16 +0200 Subject: [PATCH 01/12] Switch to buildpack-deps base image --- Dockerfile | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index e405f8c..54c3763 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM buildpack-deps:bionic RUN . /etc/os-release && \ apt-get update && \ apt-get install -y gnupg && \ diff --git a/README.md b/README.md index 189c875..16826d7 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ This is a Docker image that has many different Python versions pre-installed. It also comes with [tox](https://tox.readthedocs.io) so you can easily test your code on several different Python versions. ## 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: +The image is based on the [buildpack-deps image](https://hub.docker.com/_/buildpack-deps/). It is currently using Ubuntu 18.04. Python packages come from [the Deadsnakes PPA](https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa). The following Python runtimes and their header packages are installed: * Python 2.3 * Python 2.4 From 135ca8d81e8a2a262d75da416a1898dcc26fa890 Mon Sep 17 00:00:00 2001 From: Felix Krull Date: Wed, 15 Apr 2020 19:08:24 +0200 Subject: [PATCH 02/12] Add flit --- Dockerfile | 8 +++++++- README.md | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 54c3763..e659545 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,8 +7,10 @@ RUN . /etc/os-release && \ apt-get update && \ apt-get install -y \ python-pip \ + python-setuptools \ python3-pip \ python3-distutils \ + python3-setuptools \ \ python2.? \ python2.?-dev \ @@ -16,6 +18,10 @@ RUN . /etc/os-release && \ python3.?-dev \ python3.?-venv \ && \ - pip3 install tox virtualenv && \ + pip3 install \ + flit \ + tox \ + virtualenv \ + && \ apt-get --purge autoremove -y gnupg && \ rm -rf /var/cache/apt/lists diff --git a/README.md b/README.md index 16826d7..0e59785 100644 --- a/README.md +++ b/README.md @@ -20,4 +20,8 @@ The image is based on the [buildpack-deps image](https://hub.docker.com/_/buildp * Python 3.8 * Python 3.9 -This includes the header packages (`pythonx.y-dev`), venv, and distutils where applicable. In addition, tox and virtualenv are pre-installed. +The following additional Python development tools are installed: + +* [flit](https://flit.readthedocs.io/) +* [tox](https://tox.readthedocs.io) +* [virtualenv](https://virtualenv.pypa.io/) From 926867f18830d28c8c4d527eb14f58a389b467d8 Mon Sep 17 00:00:00 2001 From: Felix Krull Date: Wed, 15 Apr 2020 19:30:31 +0200 Subject: [PATCH 03/12] Add versions file to image --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index e659545..8e653e4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,3 +25,5 @@ RUN . /etc/os-release && \ && \ apt-get --purge autoremove -y gnupg && \ rm -rf /var/cache/apt/lists + +RUN dpkg-query --show python2.? python3.? > /versions From d3be66d5b8abfe32dcd25d3626623d61a183ce03 Mon Sep 17 00:00:00 2001 From: Felix Krull Date: Wed, 15 Apr 2020 19:30:45 +0200 Subject: [PATCH 04/12] Remove ye olde Makefile --- .gitignore | 1 - Makefile | 9 --------- Vagrantfile | 5 ++++- 3 files changed, 4 insertions(+), 11 deletions(-) delete mode 100644 Makefile diff --git a/.gitignore b/.gitignore index 341e568..dace708 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ /.vagrant -/versions diff --git a/Makefile b/Makefile deleted file mode 100644 index bf6ff51..0000000 --- a/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -TAG := fkrull/multi-python - -all: image versions-file - -image: - docker build -t $(TAG) . - -versions-file: - docker run --rm $(TAG) dpkg-query --show python2.? python3.? > versions diff --git a/Vagrantfile b/Vagrantfile index bc6aa3d..ad0fb3c 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -5,6 +5,9 @@ Vagrant.configure("2") do |config| config.vm.box = "bento/ubuntu-18.04" config.vm.provision :docker config.vm.provision :shell, inline: <<-EOF - echo cd /vagrant >> ~vagrant/.profile + script=/usr/local/bin/build-image + echo '#!/bin/sh' > $script + echo 'docker build -t fkrull/multi-python /vagrant' >> $script + chmod +x $script EOF end From ecb426c92843eb5021683db222a58ee98b21cfae Mon Sep 17 00:00:00 2001 From: Felix Krull Date: Wed, 15 Apr 2020 20:29:39 +0200 Subject: [PATCH 05/12] Simplify Vagrantfile again --- Vagrantfile | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index ad0fb3c..9fe1e55 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -5,9 +5,6 @@ Vagrant.configure("2") do |config| config.vm.box = "bento/ubuntu-18.04" config.vm.provision :docker config.vm.provision :shell, inline: <<-EOF - script=/usr/local/bin/build-image - echo '#!/bin/sh' > $script - echo 'docker build -t fkrull/multi-python /vagrant' >> $script - chmod +x $script + echo "cd /vagrant" >> ~vagrant/.profile EOF end From a5777a7d51eb280a08f42877725b1c90f9661faa Mon Sep 17 00:00:00 2001 From: Felix Krull Date: Wed, 15 Apr 2020 20:29:56 +0200 Subject: [PATCH 06/12] Create separate Dockerfiles for bionic and focal --- Dockerfile | 29 ----------------------------- Dockerfile.bionic | 3 +++ Dockerfile.focal | 3 +++ README.md | 6 +++++- setup.sh | 35 +++++++++++++++++++++++++++++++++++ 5 files changed, 46 insertions(+), 30 deletions(-) delete mode 100644 Dockerfile create mode 100644 Dockerfile.bionic create mode 100644 Dockerfile.focal create mode 100644 setup.sh diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 8e653e4..0000000 --- a/Dockerfile +++ /dev/null @@ -1,29 +0,0 @@ -FROM buildpack-deps:bionic -RUN . /etc/os-release && \ - apt-get update && \ - apt-get install -y gnupg && \ - echo "deb http://ppa.launchpad.net/deadsnakes/ppa/ubuntu ${UBUNTU_CODENAME} main" > /etc/apt/sources.list.d/deadsnakes.list && \ - apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F23C5A6CF475977595C89F51BA6932366A755776 && \ - apt-get update && \ - apt-get install -y \ - python-pip \ - python-setuptools \ - python3-pip \ - python3-distutils \ - python3-setuptools \ - \ - python2.? \ - python2.?-dev \ - python3.? \ - python3.?-dev \ - python3.?-venv \ - && \ - pip3 install \ - flit \ - tox \ - virtualenv \ - && \ - apt-get --purge autoremove -y gnupg && \ - rm -rf /var/cache/apt/lists - -RUN dpkg-query --show python2.? python3.? > /versions diff --git a/Dockerfile.bionic b/Dockerfile.bionic new file mode 100644 index 0000000..035297f --- /dev/null +++ b/Dockerfile.bionic @@ -0,0 +1,3 @@ +FROM buildpack-deps:bionic +COPY setup.sh / +RUN bash setup.sh && rm /setup.sh diff --git a/Dockerfile.focal b/Dockerfile.focal new file mode 100644 index 0000000..d4bbd93 --- /dev/null +++ b/Dockerfile.focal @@ -0,0 +1,3 @@ +FROM buildpack-deps:focal +COPY setup.sh / +RUN bash setup.sh && rm /setup.sh diff --git a/README.md b/README.md index 0e59785..4bf4cb8 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,12 @@ This is a Docker image that has many different Python versions pre-installed. It also comes with [tox](https://tox.readthedocs.io) so you can easily test your code on several different Python versions. +## Tags + +* [`bionic`, `latest`](https://github.com/fkrull/docker-multi-python/blob/master/Dockerfile.bionic) + ## Details -The image is based on the [buildpack-deps image](https://hub.docker.com/_/buildpack-deps/). It is currently using Ubuntu 18.04. Python packages come from [the Deadsnakes PPA](https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa). The following Python runtimes and their header packages are installed: +The image is based on the [buildpack-deps image](https://hub.docker.com/_/buildpack-deps/). Python packages come from [the Deadsnakes PPA](https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa). The following Python runtimes and their header packages are installed: * Python 2.3 * Python 2.4 diff --git a/setup.sh b/setup.sh new file mode 100644 index 0000000..ec9244f --- /dev/null +++ b/setup.sh @@ -0,0 +1,35 @@ +#!/bin/sh +set -eu + +. /etc/os-release + +apt-get update +apt-get install -y gnupg +echo "deb http://ppa.launchpad.net/deadsnakes/ppa/ubuntu ${UBUNTU_CODENAME} main" > /etc/apt/sources.list.d/deadsnakes.list +apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F23C5A6CF475977595C89F51BA6932366A755776 + +apt-get update +apt-get install -y \ + python-pip \ + python-setuptools \ + python3-pip \ + python3-distutils \ + python3-setuptools \ + \ + python2.? \ + python2.?-dev \ + python3.? \ + python3.?-dev \ + python3.?-venv \ + ; + +pip3 install \ + flit \ + tox \ + virtualenv \ + ; + +apt-get --purge autoremove -y gnupg +rm -rf /var/cache/apt/lists + +dpkg-query --show python2.? python3.? > /versions From f699c956232e43e0004b3639dcbc4463942c0714 Mon Sep 17 00:00:00 2001 From: Felix Krull Date: Wed, 29 Apr 2020 22:24:57 +0200 Subject: [PATCH 07/12] Don't install Python2 pip for focal --- Dockerfile.bionic | 3 +++ setup.sh | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile.bionic b/Dockerfile.bionic index 035297f..5c4a839 100644 --- a/Dockerfile.bionic +++ b/Dockerfile.bionic @@ -1,3 +1,6 @@ FROM buildpack-deps:bionic COPY setup.sh / RUN bash setup.sh && rm /setup.sh +RUN apt-get update && \ + apt-get install -y python-pip python-setuptools && \ + rm -rf /var/cache/apt/lists diff --git a/setup.sh b/setup.sh index ec9244f..b09c0a5 100644 --- a/setup.sh +++ b/setup.sh @@ -10,8 +10,6 @@ apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F23C5A6CF475977595C89F5 apt-get update apt-get install -y \ - python-pip \ - python-setuptools \ python3-pip \ python3-distutils \ python3-setuptools \ From 2fb60d333f3e407fea4ceb4293b414cc435ff084 Mon Sep 17 00:00:00 2001 From: Felix Krull Date: Thu, 30 Apr 2020 18:16:30 +0200 Subject: [PATCH 08/12] Update readme --- README.md | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 4bf4cb8..5c7d610 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,25 @@ # Docker Image With Many Python Versions -This is a Docker image that has many different Python versions pre-installed. It also comes with [tox](https://tox.readthedocs.io) so you can easily test your code on several different Python versions. +This is a Docker image that has many different Python versions pre-installed. The image is based on the [buildpack-deps image](https://hub.docker.com/_/buildpack-deps/). Python packages come from [the Deadsnakes PPA](https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa). + +The following additional Python development tools are installed: + +* [flit](https://flit.readthedocs.io/) +* [tox](https://tox.readthedocs.io) +* [virtualenv](https://virtualenv.pypa.io/) ## Tags -* [`bionic`, `latest`](https://github.com/fkrull/docker-multi-python/blob/master/Dockerfile.bionic) +### [`focal`, `latest`](https://github.com/fkrull/docker-multi-python/blob/master/Dockerfile.focal) + +Contains: + +* Python 2.7 +* Python 3.5+ + +### [`bionic`](https://github.com/fkrull/docker-multi-python/blob/master/Dockerfile.bionic) -## Details -The image is based on the [buildpack-deps image](https://hub.docker.com/_/buildpack-deps/). Python packages come from [the Deadsnakes PPA](https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa). The following Python runtimes and their header packages are installed: +Contains: * Python 2.3 * Python 2.4 @@ -23,9 +35,4 @@ The image is based on the [buildpack-deps image](https://hub.docker.com/_/buildp * Python 3.7 * Python 3.8 * Python 3.9 - -The following additional Python development tools are installed: - -* [flit](https://flit.readthedocs.io/) -* [tox](https://tox.readthedocs.io) -* [virtualenv](https://virtualenv.pypa.io/) +* `pip` for Python 2.7 From ac4cc4be0adb14d7f55a2070f620933895d727a3 Mon Sep 17 00:00:00 2001 From: Michal Kubek Date: Thu, 23 Feb 2023 10:14:39 +0100 Subject: [PATCH 09/12] Add support for python 3.10 and 3.11 --- README.md | 2 ++ setup.sh | 3 +++ 2 files changed, 5 insertions(+) diff --git a/README.md b/README.md index 5c7d610..8a3625a 100644 --- a/README.md +++ b/README.md @@ -35,4 +35,6 @@ Contains: * Python 3.7 * Python 3.8 * Python 3.9 +* Python 3.10 +* Python 3.11 * `pip` for Python 2.7 diff --git a/setup.sh b/setup.sh index b09c0a5..d4c6b17 100644 --- a/setup.sh +++ b/setup.sh @@ -19,6 +19,9 @@ apt-get install -y \ python3.? \ python3.?-dev \ python3.?-venv \ + python3.?? \ + python3.??-dev \ + python3.??-venv \ ; pip3 install \ From 7c0aef2b014289592614df15231b47aa26c0a728 Mon Sep 17 00:00:00 2001 From: Felix Krull Date: Tue, 7 Mar 2023 19:28:15 +0100 Subject: [PATCH 10/12] Update setup.sh --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index d4c6b17..72e579a 100644 --- a/setup.sh +++ b/setup.sh @@ -33,4 +33,4 @@ pip3 install \ apt-get --purge autoremove -y gnupg rm -rf /var/cache/apt/lists -dpkg-query --show python2.? python3.? > /versions +dpkg-query --show python2.? python3.? python3.?? > /versions From 903f90ecfaf7630ceb6dadef4adfe9b41bf5baf3 Mon Sep 17 00:00:00 2001 From: Felix Krull <2378306+fkrull@users.noreply.github.com> Date: Mon, 31 Jul 2023 21:53:47 +0200 Subject: [PATCH 11/12] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 8a3625a..c6b14f4 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ +# DEPRECATED/REMOVED +This repository is not being updated any more. The image was removed from Docker Hub as well. + # Docker Image With Many Python Versions This is a Docker image that has many different Python versions pre-installed. The image is based on the [buildpack-deps image](https://hub.docker.com/_/buildpack-deps/). Python packages come from [the Deadsnakes PPA](https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa). From f7cbd6a850504d8ae62a6cc2edd400e17ed35d70 Mon Sep 17 00:00:00 2001 From: Felix Krull <2378306+fkrull@users.noreply.github.com> Date: Tue, 1 Aug 2023 21:45:22 +0200 Subject: [PATCH 12/12] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c6b14f4..48a3452 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # DEPRECATED/REMOVED -This repository is not being updated any more. The image was removed from Docker Hub as well. +This repository is not being updated any more. You can find the last version of the image in the [repository's packages](https://github.com/fkrull/docker-multi-python/pkgs/container/docker-multi-python). # Docker Image With Many Python Versions