Sign inSign up

bsidebotham/python-builder

By bsidebotham

•Updated over 5 years ago

Containers for building Python from source

Image
1

307

bsidebotham/python-builder repository overview

⁠Python Builder

Various containers to build Python from source. All of the necessary build dependencies are installed.

Build times are significantly quicker with Python >= 3.8.

An example of using these containers to build a CentOS7 Python RPM:

$ docker run -v $(pwd):/build bsidebotham/python-builder:centos7
...

$ ls -l ./RPMS/x86_64/
-rw-r--r--. 1 root root 32229524 Mar 31 16:08 python39-3.9.2-1.el7.x86_64.rpm

You can go ahead and build other versions too using the PYTHONVERSION environment variable:

$ docker run -e PYTHONVERSION=3.8.8 -v $(pwd):/build bsidebotham/python-builder:centos7
...

$ ls -l ./RPMS/x86_64/
-rw-r--r--. 1 root root 31839876 Mar 31 17:00 python38-3.8.8-1.el7.x86_64.rpm
-rw-r--r--. 1 root root 32228720 Mar 31 16:55 python39-3.9.2-1.el7.x86_64.rpm

NOTE: You can only do multiple builds in the same volume if you're doing different python versions for the same OS. If you try to build for a different OS in the same volume you are likely to get (possibly subtle!) issues.

⁠ENVIRONMENT VARIABLES

  • PYTHONVERSION The verison of Python to build and package

Tag summary

Content type

Image

Digest

Size

123.4 MB

Last updated

over 5 years ago

docker pull bsidebotham/python-builder:ubuntu20.04