Skip to content

Commit

Permalink
Feature/python 313 (#15)
Browse files Browse the repository at this point in the history
* fix readme

* Fix tags

* Add python 3.13
  • Loading branch information
mosquito authored Feb 21, 2024
1 parent 5e6d4b1 commit 8042140
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 27 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ jobs:
tag: "3.11"
- context: "python3.12"
tag: "3.12"
- context: "python3.13"
tag: "3.13"

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -132,6 +134,8 @@ jobs:
tag: 3.11-pillow
- context: pillow/3.12
tag: 3.12-pillow
- context: pillow/3.13
tag: 3.13-pillow
- context: pillow/all
tag: all-pillow

Expand Down
22 changes: 16 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ images: build-base \
build-python-3.10 \
build-python-3.11 \
build-python-3.12 \
build-python-3.13 \
build-pillow-3.8 \
build-pillow-3.9 \
build-pillow-3.10 \
build-pillow-3.11 \
build-pillow-3.12 \
build-pillow-3.13 \
build-ipython \
build-black \
build-certbot \
Expand Down Expand Up @@ -45,23 +47,29 @@ build-python-3.11:
build-python-3.12:
$(call build,python3.12,3.12:latest)

build-python-3.13:
$(call build,python3.13,3.13:latest)

build-pillow-all:
$(call build,pillow/all,all:pillow)
$(call build,pillow/all,all-pillow)

build-pillow-3.8:
$(call build,pillow/3.8,3.8:pillow)
$(call build,pillow/3.8,3.8-pillow)

build-pillow-3.9:
$(call build,pillow/3.9,3.9:pillow)
$(call build,pillow/3.9,3.9-pillow)

build-pillow-3.10:
$(call build,pillow/3.10,3.10:pillow)
$(call build,pillow/3.10,3.10-pillow)

build-pillow-3.11:
$(call build,pillow/3.11,3.11:pillow)
$(call build,pillow/3.11,3.11-pillow)

build-pillow-3.12:
$(call build,pillow/3.12,3.12:pillow)
$(call build,pillow/3.12,3.12-pillow)

build-pillow-3.13:
$(call build,pillow/3.13,3.13-pillow)

build-black:
$(call build,black,app/black:latest)
Expand Down Expand Up @@ -90,8 +98,10 @@ publish:
$(call publish,3.10)
$(call publish,3.11)
$(call publish,3.12)
$(call publish,3.13)
$(call publish,3.8-pillow)
$(call publish,3.9-pillow)
$(call publish,3.10-pillow)
$(call publish,3.11-pillow)
$(call publish,3.12-pillow)
$(call publish,3.13-pillow)
42 changes: 22 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,29 +43,31 @@ Image descriptions

The images according to their purpose and features:

Tag | Info | Purpose | Features
------- | ---- | ------- | --------
all | ![](https://flat.badgen.net/docker/size/snakepacker/python/all/amd64?label=size) | build stage | all available python versions, libpython headers and compiler
all-pillow | ![](https://flat.badgen.net/docker/size/snakepacker/python/all-pillow/amd64?label=size) | build stage | all available python versions, libpython headers, graphics libraries headers and compiler
[3.12](https://docs.python.org/3/whatsnew/3.12.html) | ![](https://flat.badgen.net/docker/size/snakepacker/python/3.12/amd64?label=size) | target stage | pure python 3.12
[3.11](https://docs.python.org/3/whatsnew/3.11.html) | ![](https://flat.badgen.net/docker/size/snakepacker/python/3.11/amd64?label=size) | target stage | pure python 3.11
[3.10](https://docs.python.org/3/whatsnew/3.10.html) | ![](https://flat.badgen.net/docker/size/snakepacker/python/3.10/amd64?label=size) | target stage | pure python 3.10
[3.9](https://docs.python.org/3/whatsnew/3.9.html) | ![](https://flat.badgen.net/docker/size/snakepacker/python/3.9/amd64?label=size) | target stage | pure python 3.9
[3.8](https://docs.python.org/3/whatsnew/3.8.html) | ![](https://flat.badgen.net/docker/size/snakepacker/python/3.8/amd64?label=size) | target stage | pure python 3.8
Tag | Info | Purpose | Features
------- |------------------------------------------------------------------------------------------| ------- | --------
all | ![](https://flat.badgen.net/docker/size/snakepacker/python/all/amd64?label=size) | build stage | all available python versions, libpython headers and compiler
all-pillow | ![](https://flat.badgen.net/docker/size/snakepacker/python/all-pillow/amd64?label=size) | build stage | all available python versions, libpython headers, graphics libraries headers and compiler
[3.13](https://docs.python.org/3/whatsnew/3.13.html) | ![](https://flat.badgen.net/docker/size/snakepacker/python/3.13/amd64?label=size) | target stage | pure python 3.13
[3.12](https://docs.python.org/3/whatsnew/3.12.html) | ![](https://flat.badgen.net/docker/size/snakepacker/python/3.12/amd64?label=size) | target stage | pure python 3.12
[3.11](https://docs.python.org/3/whatsnew/3.11.html) | ![](https://flat.badgen.net/docker/size/snakepacker/python/3.11/amd64?label=size) | target stage | pure python 3.11
[3.10](https://docs.python.org/3/whatsnew/3.10.html) | ![](https://flat.badgen.net/docker/size/snakepacker/python/3.10/amd64?label=size) | target stage | pure python 3.10
[3.9](https://docs.python.org/3/whatsnew/3.9.html) | ![](https://flat.badgen.net/docker/size/snakepacker/python/3.9/amd64?label=size) | target stage | pure python 3.9
[3.8](https://docs.python.org/3/whatsnew/3.8.html) | ![](https://flat.badgen.net/docker/size/snakepacker/python/3.8/amd64?label=size) | target stage | pure python 3.8
[3.13-pillow](https://docs.python.org/3/whatsnew/3.13.html) | ![](https://flat.badgen.net/docker/size/snakepacker/python/3.13-pillow/amd64?label=size) | target stage | pure python 3.13 with graphics libraries binaries
[3.12-pillow](https://docs.python.org/3/whatsnew/3.12.html) | ![](https://flat.badgen.net/docker/size/snakepacker/python/3.12-pillow/amd64?label=size) | target stage | pure python 3.12 with graphics libraries binaries
[3.11-pillow](https://docs.python.org/3/whatsnew/3.11.html) | ![](https://flat.badgen.net/docker/size/snakepacker/python/3.11-pillow/amd64?label=size) | target stage | pure python 3.11 with graphics libraries binaries
[3.10-pillow](https://docs.python.org/3/whatsnew/3.10.html) | ![](https://flat.badgen.net/docker/size/snakepacker/python/3.10-pillow/amd64?label=size) | target stage | pure python 3.10 with graphics libraries binaries
[3.9-pillow](https://docs.python.org/3/whatsnew/3.9.html) | ![](https://flat.badgen.net/docker/size/snakepacker/python/3.9-pillow/amd64?label=size) | target stage | pure python 3.9 with graphics libraries binaries
[3.8-pillow](https://docs.python.org/3/whatsnew/3.8.html) | ![](https://flat.badgen.net/docker/size/snakepacker/python/3.8-pillow/amd64?label=size) | target stage | pure python 3.8 with graphics libraries binaries
[pylama](https://pylama.readthedocs.io/en/latest/) | ![](https://flat.badgen.net/docker/size/snakepacker/python/pylama/amd64?label=size) | ready to use | pylama application image (useful for CI)
[pylava](https://pylavadocs.readthedocs.io/en/latest/) | ![](https://flat.badgen.net/docker/size/snakepacker/python/pylava/amd64?label=size) | ready to use | pylava application image (useful for CI)
[ipython](https://jupyter.org) | ![](https://flat.badgen.net/docker/size/snakepacker/python/ipython/amd64?label=size) | ready to use | ipython application image
[certbot](https://certbot.eff.org) | ![](https://flat.badgen.net/docker/size/snakepacker/python/certbot/amd64?label=size) | ready to use | certbot application image
[black](https://black.readthedocs.io/en/stable/) | ![](https://flat.badgen.net/docker/size/snakepacker/python/black/amd64?label=size) | ready to use | black application image (useful for CI)
[gray](https://github.com/dizballanze/gray) | ![](https://flat.badgen.net/docker/size/snakepacker/python/gray/amd64?label=size) | ready to use | gray application image (useful for CI)
[ruff](https://github.com/astral-sh/ruff) | ![](https://flat.badgen.net/docker/size/snakepacker/python/ruff/amd64?label=size) | ready to use | ruff linter image (useful for CI)
[jupyterlab](https://github.com/jupyterlab/jupyterlab) | ![](https://flat.badgen.net/docker/size/snakepacker/python/jupyterlab/amd64?label=size) | ready to use | jupyterlab image
base | ![](https://flat.badgen.net/docker/size/snakepacker/python/base/amd64?label=size) | | common layers
[3.9-pillow](https://docs.python.org/3/whatsnew/3.9.html) | ![](https://flat.badgen.net/docker/size/snakepacker/python/3.9-pillow/amd64?label=size) | target stage | pure python 3.9 with graphics libraries binaries
[3.8-pillow](https://docs.python.org/3/whatsnew/3.8.html) | ![](https://flat.badgen.net/docker/size/snakepacker/python/3.8-pillow/amd64?label=size) | target stage | pure python 3.8 with graphics libraries binaries
[pylama](https://pylama.readthedocs.io/en/latest/) | ![](https://flat.badgen.net/docker/size/snakepacker/python/pylama/amd64?label=size) | ready to use | pylama application image (useful for CI)
[pylava](https://pylavadocs.readthedocs.io/en/latest/) | ![](https://flat.badgen.net/docker/size/snakepacker/python/pylava/amd64?label=size) | ready to use | pylava application image (useful for CI)
[ipython](https://jupyter.org) | ![](https://flat.badgen.net/docker/size/snakepacker/python/ipython/amd64?label=size) | ready to use | ipython application image
[certbot](https://certbot.eff.org) | ![](https://flat.badgen.net/docker/size/snakepacker/python/certbot/amd64?label=size) | ready to use | certbot application image
[black](https://black.readthedocs.io/en/stable/) | ![](https://flat.badgen.net/docker/size/snakepacker/python/black/amd64?label=size) | ready to use | black application image (useful for CI)
[gray](https://github.com/dizballanze/gray) | ![](https://flat.badgen.net/docker/size/snakepacker/python/gray/amd64?label=size) | ready to use | gray application image (useful for CI)
[ruff](https://github.com/astral-sh/ruff) | ![](https://flat.badgen.net/docker/size/snakepacker/python/ruff/amd64?label=size) | ready to use | ruff linter image (useful for CI)
[jupyterlab](https://github.com/jupyterlab/jupyterlab) | ![](https://flat.badgen.net/docker/size/snakepacker/python/jupyterlab/amd64?label=size) | ready to use | jupyterlab image
base | ![](https://flat.badgen.net/docker/size/snakepacker/python/base/amd64?label=size) | | common layers


Concept
Expand Down
4 changes: 3 additions & 1 deletion all/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ RUN apt-install -y python3.9 python3.9-dev python3.9-venv
RUN apt-install -y python3.10 python3.10-dev python3.10-venv python3.10-distutils
RUN apt-install -y python3.11 python3.11-dev python3.11-venv python3.11-distutils
RUN apt-install -y python3.12 python3.12-dev python3.12-venv python3.12-distutils
RUN apt-install -y python3.13 python3.13-dev python3.13-venv python3.13-nogil

RUN apt-install \
cargo \
Expand All @@ -43,7 +44,8 @@ RUN \
python3.9 /usr/share/python/get-pip.py "pip == 24.0" "setuptools < 60" "wheel == 0.37.0" "cython" && \
python3.10 /usr/share/python/get-pip.py "pip == 24.0" "setuptools < 60" "wheel == 0.37.0" "cython" && \
python3.11 /usr/share/python/get-pip.py "pip == 24.0" "setuptools < 60" "wheel == 0.37.0" "cython" && \
python3.12 /usr/share/python/get-pip.py "pip == 24.0" "setuptools < 60" "wheel == 0.37.0" "cython"
python3.12 /usr/share/python/get-pip.py "pip == 24.0" "setuptools < 60" "wheel == 0.37.0" "cython" && \
python3.13 /usr/share/python/get-pip.py "pip == 24.0" "setuptools < 60" "wheel == 0.37.0" "cython"

# Upgrade preinstalled wheels
RUN rm -fr \
Expand Down
30 changes: 30 additions & 0 deletions pillow/3.13/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM ghcr.io/snakepacker/python/all as builder

# https://pillow.readthedocs.io/en/stable/installation.html#building-from-source
RUN apt-install \
libfreetype6-dev \
libfribidi-dev \
libgif-dev \
libharfbuzz-dev \
libimagequant-dev \
libjpeg-dev \
libjpeg8-dev \
liblcms2-dev \
libopenjp2-7-dev \
libpng-dev \
libraqm-dev \
libtiff-dev \
libtiff5-dev \
libwebp-dev \
libxcb1-dev \
zlib1g-dev

RUN python3 -m venv /var/tmp/pillow-venv
RUN /var/tmp/pillow-venv/bin/pip install --no-binary=:all: pillow
RUN find-libdeps /var/tmp/pillow-venv > /usr/share/python3/pillow-runtime-libs.txt

############################################################################

FROM ghcr.io/snakepacker/python/3.13
COPY --from=builder /usr/share/python3/pillow-runtime-libs.txt /usr/share/python3/pillow-runtime-libs.txt
RUN xargs -ra /usr/share/python3/pillow-runtime-libs.txt apt-install
4 changes: 4 additions & 0 deletions python3.13/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM ghcr.io/snakepacker/python/base

# Install python
RUN apt-install python3.13-minimal libpython3.13-stdlib python3.13-nogil

0 comments on commit 8042140

Please sign in to comment.