Sign inSign up

dubzland/python-builder

By dubzland

•Updated over 1 year ago

Basic image with tooling installed required to build various versions of Python.

Image
Integration & delivery
0

1.3K

dubzland/python-builder repository overview

⁠Docker Image: Python Builder

Gitlab pipeline Docker pulls License Liberapay patrons Liberapay receiving

Basic image with tooling installed required to build various versions of Python.

⁠Usage

This image is intended to be used as the first stage of a multi-stage build. For example:

FROM dubzland/python-builder:1.0-alpine as build

ARG PYTHON_VERSIONS="3.10 3.11 3.12"

RUN build-python-versions -o /tmp/ $PYTHON_VERSIONS

FROM alpine:3.19

ENV PATH /usr/local/bin:$PATH

COPY --from=build /tmp/python-all.tar.gz /tmp/python.tar.gz

RUN tar -C / -xzf /tmp/python-all.tar.gz && \
	rm /tmp/python.tar.gz

Once the image is built, Pythons will be installed in /usr/local/bin. The binaries are installed as pythonX.Y.

To fully enable the execution of Python in the resulting image (including building additional modules), ensure the required packages are installed:

⁠Alpine
apk add --no-cache bash ca-certificates curl gcc git libexpat libffi-dev \
    musl-dev sqlite-libs yaml-dev
⁠Debian
apt-get install -y --no-install-recommends gcc gnupg2 libbz2-dev libgdbm-dev \
    libgdbm-compat-dev libffi-dev liblzma-dev libncurses-dev libreadline-dev \
    libsqlite3-dev libssl-dev tk-dev uuid-dev
⁠Ubuntu
sudo apt-get install -y --no-install-recommends build-essential gdb lcov pkg-config \
      libbz2-dev libffi-dev libgdbm-dev libgdbm-compat-dev liblzma-dev \
      libncurses5-dev libreadline6-dev libsqlite3-dev libssl-dev \
      lzma lzma-dev tk-dev uuid-dev zlib1g-dev

Depending on the exact release of the operating system, these lists may differ slightly.

⁠License

MIT

⁠Author

Tag summary

Content type

Image

Digest

sha256:83d92c12b…

Size

97.6 MB

Last updated

over 1 year ago

docker pull dubzland/python-builder