Skip to content

Commit 1f3b35f

Browse files
committed
v3.11.12,v3.12.10
0 parents  commit 1f3b35f

13 files changed

Lines changed: 943 additions & 0 deletions

File tree

.dockerignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.DS_Store
2+
.idea
3+
.vscode
4+
.env
5+
.git
6+
.gitattributes
7+
.gitignore

.editorconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
8+
[**.{yml, sh}]
9+
indent_style = space
10+
indent_size = 2
11+
12+
[Dockerfile]
13+
indent_style = space
14+
indent_size = 2

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
target-branch: "master"
6+
schedule:
7+
interval: "monthly"

.github/workflows/ci.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Docker Image CI
2+
on:
3+
push:
4+
branches:
5+
- master
6+
schedule:
7+
- cron: 0 4 * * *
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
major: [ 3.11, 3.12 ]
14+
os: [ debian, alpine ]
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
- name: Set variables
19+
id: vars
20+
working-directory: ${{ matrix.major }}/${{ matrix.os }}
21+
run: |
22+
echo "repository=${GITHUB_ACTOR}/$(basename ${GITHUB_REPOSITORY})" >> $GITHUB_OUTPUT
23+
echo "version=$(grep -oE 'PYTHON_VERSION [0-9].[0-9]+.[0-9]+' Dockerfile | grep -oE '[0-9].[0-9]+.[0-9]+')" >> $GITHUB_OUTPUT
24+
echo "workdir=${{ matrix.major }}/${{ matrix.os }}" >> $GITHUB_OUTPUT
25+
- name: Docker meta
26+
id: meta
27+
uses: docker/metadata-action@v5
28+
with:
29+
images: ${{ steps.vars.outputs.repository }})
30+
tags: |
31+
type=raw,value=${{ matrix.major }}-${{ matrix.os }}
32+
type=raw,value=${{ steps.vars.outputs.version }}-${{ matrix.os }}
33+
${{ (matrix.os == 'debian' && format('type=raw,value={0}', matrix.major)) || '' }}
34+
${{ (matrix.os == 'debian' && format('type=raw,value={0}', steps.vars.outputs.version)) || '' }}
35+
- name: Set up QEMU
36+
uses: docker/setup-qemu-action@v3
37+
- name: Set up Docker Buildx
38+
uses: docker/setup-buildx-action@v3
39+
- name: Login to DockerHub
40+
uses: docker/login-action@v3
41+
with:
42+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
43+
password: ${{ secrets.DOCKER_HUB_TOKEN }}
44+
- name: Copy files
45+
run: |
46+
cp -f files/docker-php-ext-* ${{ steps.vars.outputs.workdir }}
47+
cp -f files/docker-php-source ${{ steps.vars.outputs.workdir }}
48+
cp -f files/docker-php-entrypoint-${{ matrix.variant }} ${{ steps.vars.outputs.workdir }}/docker-php-entrypoint
49+
tree ${{ steps.vars.outputs.workdir }}
50+
- name: Build and push
51+
uses: docker/build-push-action@v5
52+
with:
53+
context: ${{ steps.vars.outputs.workdir }}
54+
pull: true
55+
push: true
56+
platforms: linux/amd64,linux/arm64
57+
tags: ${{ steps.meta.outputs.tags }}

.github/workflows/dockerhub.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Docker Hub Description
2+
on:
3+
push:
4+
branches:
5+
- master
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v4
12+
- name: Set variables
13+
id: vars
14+
run: |
15+
echo "repository=${GITHUB_ACTOR}/$(basename ${GITHUB_REPOSITORY})" >> $GITHUB_OUTPUT
16+
- name: Docker Hub Description
17+
uses: peter-evans/dockerhub-description@v4
18+
with:
19+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
20+
password: ${{ secrets.DOCKER_HUB_TOKEN }}
21+
repository: ${{ steps.vars.outputs.repository }}
22+
short-description: ${{ github.event.repository.description }}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.DS_Store
2+
.idea
3+
.vscode
4+
.env

3.11/alpine/Dockerfile

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
#
2+
#--------------------------------------------------------------------------
3+
# python 3.12 alpine
4+
#--------------------------------------------------------------------------
5+
#
6+
7+
FROM alpine:3.21
8+
9+
# ensure local python is preferred over distribution python
10+
ENV PATH /usr/local/bin:$PATH
11+
12+
# cannot remove LANG even though https://bugs.python.org/issue19846 is fixed
13+
# last attempted removal of LANG broke many users:
14+
# https://github.com/docker-library/python/pull/570
15+
ENV LANG C.UTF-8
16+
17+
# runtime dependencies
18+
RUN set -eux; \
19+
apk add --no-cache \
20+
ca-certificates \
21+
tzdata \
22+
;
23+
24+
ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D
25+
ENV PYTHON_VERSION 3.11.12
26+
ENV PYTHON_SHA256 849da87af4df137710c1796e276a955f7a85c9f971081067c8f565d15c352a09
27+
28+
RUN set -eux; \
29+
\
30+
apk add --no-cache --virtual .build-deps \
31+
gnupg \
32+
tar \
33+
xz \
34+
\
35+
bluez-dev \
36+
bzip2-dev \
37+
dpkg-dev dpkg \
38+
findutils \
39+
gcc \
40+
gdbm-dev \
41+
libc-dev \
42+
libffi-dev \
43+
libnsl-dev \
44+
libtirpc-dev \
45+
linux-headers \
46+
make \
47+
ncurses-dev \
48+
openssl-dev \
49+
pax-utils \
50+
readline-dev \
51+
sqlite-dev \
52+
tcl-dev \
53+
tk \
54+
tk-dev \
55+
util-linux-dev \
56+
xz-dev \
57+
zlib-dev \
58+
; \
59+
\
60+
wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; \
61+
echo "$PYTHON_SHA256 *python.tar.xz" | sha256sum -c -; \
62+
wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc"; \
63+
GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \
64+
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$GPG_KEY"; \
65+
gpg --batch --verify python.tar.xz.asc python.tar.xz; \
66+
gpgconf --kill all; \
67+
rm -rf "$GNUPGHOME" python.tar.xz.asc; \
68+
mkdir -p /usr/src/python; \
69+
tar --extract --directory /usr/src/python --strip-components=1 --file python.tar.xz; \
70+
rm python.tar.xz; \
71+
\
72+
cd /usr/src/python; \
73+
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \
74+
./configure \
75+
--build="$gnuArch" \
76+
--enable-loadable-sqlite-extensions \
77+
--enable-option-checking=fatal \
78+
--enable-shared \
79+
--with-lto \
80+
--with-ensurepip \
81+
; \
82+
nproc="$(nproc)"; \
83+
# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit()
84+
# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0
85+
EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \
86+
LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \
87+
make -j "$nproc" \
88+
"EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \
89+
"LDFLAGS=${LDFLAGS:-}" \
90+
; \
91+
# https://github.com/docker-library/python/issues/784
92+
# prevent accidental usage of a system installed libpython of the same version
93+
rm python; \
94+
make -j "$nproc" \
95+
"EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \
96+
"LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \
97+
python \
98+
; \
99+
make install; \
100+
\
101+
cd /; \
102+
rm -rf /usr/src/python; \
103+
\
104+
find /usr/local -depth \
105+
\( \
106+
\( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \
107+
-o \( -type f -a \( -name '*.pyc' -o -name '*.pyo' -o -name 'libpython*.a' \) \) \
108+
\) -exec rm -rf '{}' + \
109+
; \
110+
\
111+
find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \
112+
| tr ',' '\n' \
113+
| sort -u \
114+
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
115+
| xargs -rt apk add --no-network --virtual .python-rundeps \
116+
; \
117+
apk del --no-network .build-deps; \
118+
\
119+
export PYTHONDONTWRITEBYTECODE=1; \
120+
python3 --version; \
121+
\
122+
pip3 install \
123+
--disable-pip-version-check \
124+
--no-cache-dir \
125+
--no-compile \
126+
'setuptools==65.5.1' \
127+
# https://github.com/docker-library/python/issues/1023
128+
'wheel<0.46' \
129+
; \
130+
pip3 --version
131+
132+
# make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends)
133+
RUN set -eux; \
134+
for src in idle3 pip3 pydoc3 python3 python3-config; do \
135+
dst="$(echo "$src" | tr -d 3)"; \
136+
[ -s "/usr/local/bin/$src" ]; \
137+
[ ! -e "/usr/local/bin/$dst" ]; \
138+
ln -svT "$src" "/usr/local/bin/$dst"; \
139+
done
140+
141+
CMD ["python3"]

0 commit comments

Comments
 (0)