Skip to content

Commit c08a9e9

Browse files
committed
add arm64 and i386 images
1 parent 173ec4f commit c08a9e9

3 files changed

Lines changed: 216 additions & 0 deletions

File tree

.github/workflows/docker-build.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,97 @@ jobs:
5959
subject-name: ghcr.io/${{ github.repository_owner }}/buildworker_x86_64
6060
subject-digest: ${{ steps.push.outputs.digest }}
6161
push-to-registry: true
62+
63+
build-i686:
64+
runs-on: ubuntu-latest
65+
steps:
66+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
67+
68+
- name: Set up QEMU
69+
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff9c2d871b165f9253f # v3.6.0
70+
71+
- name: Set up Docker Buildx
72+
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
73+
74+
- name: Log in to GHCR
75+
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
76+
with:
77+
registry: ghcr.io
78+
username: ${{ github.actor }}
79+
password: ${{ secrets.GITHUB_TOKEN }}
80+
81+
- name: Extract metadata
82+
id: meta
83+
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0
84+
with:
85+
images: ghcr.io/${{ github.repository_owner }}/buildworker_i686
86+
tags: |
87+
type=sha,format=long
88+
type=raw,value=latest,enable={{is_default_branch}}
89+
90+
- name: Build and push
91+
id: push
92+
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
93+
with:
94+
context: docker
95+
file: docker/Dockerfile.i686
96+
platforms: linux/386
97+
push: true
98+
tags: ${{ steps.meta.outputs.tags }}
99+
labels: ${{ steps.meta.outputs.labels }}
100+
cache-from: type=gha
101+
cache-to: type=gha,mode=max
102+
provenance: true
103+
sbom: true
104+
105+
- name: Attest build provenance
106+
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4.1.0
107+
with:
108+
subject-name: ghcr.io/${{ github.repository_owner }}/buildworker_i686
109+
subject-digest: ${{ steps.push.outputs.digest }}
110+
push-to-registry: true
111+
112+
build-aarch64:
113+
runs-on: ubuntu-24.04-arm
114+
steps:
115+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
116+
117+
- name: Set up Docker Buildx
118+
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
119+
120+
- name: Log in to GHCR
121+
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
122+
with:
123+
registry: ghcr.io
124+
username: ${{ github.actor }}
125+
password: ${{ secrets.GITHUB_TOKEN }}
126+
127+
- name: Extract metadata
128+
id: meta
129+
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0
130+
with:
131+
images: ghcr.io/${{ github.repository_owner }}/buildworker_aarch64
132+
tags: |
133+
type=sha,format=long
134+
type=raw,value=latest,enable={{is_default_branch}}
135+
136+
- name: Build and push
137+
id: push
138+
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
139+
with:
140+
context: docker
141+
file: docker/Dockerfile.aarch64
142+
push: true
143+
tags: ${{ steps.meta.outputs.tags }}
144+
labels: ${{ steps.meta.outputs.labels }}
145+
cache-from: type=gha
146+
cache-to: type=gha,mode=max
147+
provenance: true
148+
sbom: true
149+
150+
- name: Attest build provenance
151+
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4.1.0
152+
with:
153+
subject-name: ghcr.io/${{ github.repository_owner }}/buildworker_aarch64
154+
subject-digest: ${{ steps.push.outputs.digest }}
155+
push-to-registry: true

docker/Dockerfile.aarch64

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Dockerfile based on manylinux_2_28_aarch64 (AlmaLinux 8, glibc 2.28, arm64)
2+
#
3+
# Build:
4+
# docker build --pull -t buildworker_aarch64 \
5+
# --build-arg BUILDWORKER_UID=1001 \
6+
# -f docker/Dockerfile.aarch64 docker
7+
#
8+
# Run interactively:
9+
# docker run -it --rm -v$(pwd):/build_dir buildworker_aarch64 /bin/bash
10+
11+
FROM quay.io/pypa/manylinux_2_28_aarch64@sha256:dee559b640ecd6c8a3dacf8c7cad3ea339c7d1f505c52efdc57891f17f2c931b
12+
WORKDIR /root
13+
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
14+
15+
RUN yum -y update
16+
RUN yum install -y \
17+
wget patch gdb vim perl texinfo \
18+
zlib-devel glibc-devel \
19+
libX11-devel libXt-devel libXft-devel tk-devel gdbm-devel \
20+
xz-devel bzip2-devel \
21+
openssl3-devel \
22+
gc-devel \
23+
ncurses-devel \
24+
libunwind-devel \
25+
perl-IPC-Cmd perl-Digest-SHA
26+
27+
RUN yum clean packages
28+
29+
# prefer our libraries in /usr/local/lib (for sqlite, libexpat, libffi built from source)
30+
ENV LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
31+
32+
# sqlite: yum provides 3.26.0 which is too old; build 3.47.2 from source
33+
ADD install_sqlite.sh /root/install_sqlite.sh
34+
RUN sh /root/install_sqlite.sh 2>&1 | tee /root/install_sqlite.log
35+
36+
# libexpat and libffi are baked into PyPy; use latest versions
37+
ADD install_libexpat.sh /root/install_libexpat.sh
38+
RUN sh /root/install_libexpat.sh 2>&1 | tee /root/install_libexpat.log
39+
40+
ADD install_libffi.sh /root/install_libffi.sh
41+
RUN sh /root/install_libffi.sh 2>&1 | tee /root/install_libffi.log
42+
43+
# get a pypy for translation and running tests
44+
RUN wget -q https://downloads.python.org/pypy/pypy2.7-v7.3.22-aarch64.tar.bz2 -O pypy2.7.tar.bz2
45+
RUN echo "49829ef97a36d50870b0a4a7d6d67c4817d98a0bbd936e7a86ac6ef615b07205 pypy2.7.tar.bz2" | sha256sum -c -
46+
RUN tar -C /opt -xj < pypy2.7.tar.bz2 && rm pypy2.7.tar.bz2
47+
RUN ln -s /opt/pypy2.7-v7.3.22-aarch64/bin/pypy /usr/local/bin/pypy
48+
RUN ln -s /opt/pypy2.7-v7.3.22-aarch64/bin/pypy /usr/local/bin/python
49+
RUN pypy -mensurepip
50+
RUN pypy -mpip install --upgrade pip==20.3.4
51+
RUN pypy -mpip install --upgrade setuptools wheel
52+
ADD requirements.txt /root/requirements.txt
53+
RUN pypy -mpip install --require-hashes -r /root/requirements.txt
54+
55+
# Define a user
56+
ARG BUILDWORKER_UID=1001
57+
ARG PARALLEL_BUILDS=4
58+
RUN adduser buildworker --uid=$BUILDWORKER_UID
59+
RUN echo parallel_runs=$PARALLEL_BUILDS > /home/buildworker/machine_cfg.py
60+
ENV PYPY_LOCALBASE=/usr/local
61+
USER buildworker

docker/Dockerfile.i686

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Dockerfile based on manylinux_2_28_i686 (AlmaLinux 8, glibc 2.28, 32-bit)
2+
#
3+
# Build:
4+
# docker build --pull -t buildworker_i686 \
5+
# --build-arg BUILDWORKER_UID=1001 \
6+
# -f docker/Dockerfile.i686 docker
7+
#
8+
# Run interactively:
9+
# docker run -it --rm -v$(pwd):/build_dir buildworker_i686 /bin/bash
10+
11+
FROM quay.io/pypa/manylinux_2_28_i686@sha256:817099eabdaf534fd802079ed185b62b97f1fc5e7027db9a14fd7540931819b9
12+
WORKDIR /root
13+
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
14+
15+
RUN yum -y update
16+
RUN yum install -y \
17+
wget patch gdb vim perl texinfo \
18+
zlib-devel glibc-devel \
19+
libX11-devel libXt-devel libXft-devel tk-devel gdbm-devel \
20+
xz-devel bzip2-devel \
21+
openssl3-devel \
22+
gc-devel \
23+
ncurses-devel \
24+
libunwind-devel \
25+
perl-IPC-Cmd perl-Digest-SHA
26+
27+
RUN yum clean packages
28+
29+
# prefer our libraries in /usr/local/lib (for sqlite, libexpat, libffi built from source)
30+
ENV LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
31+
32+
# sqlite: yum provides 3.26.0 which is too old; build 3.47.2 from source
33+
ADD install_sqlite.sh /root/install_sqlite.sh
34+
RUN sh /root/install_sqlite.sh m32 2>&1 | tee /root/install_sqlite.log
35+
36+
# libexpat and libffi are baked into PyPy; use latest versions
37+
ADD install_libexpat.sh /root/install_libexpat.sh
38+
RUN sh /root/install_libexpat.sh m32 2>&1 | tee /root/install_libexpat.log
39+
40+
ADD install_libffi.sh /root/install_libffi.sh
41+
RUN sh /root/install_libffi.sh m32 2>&1 | tee /root/install_libffi.log
42+
43+
# get a pypy for translation and running tests
44+
RUN wget -q https://downloads.python.org/pypy/pypy2.7-v7.3.22-linux32.tar.bz2 -O pypy2.7.tar.bz2
45+
RUN echo "3512d44a9005b52611ad2d84e63c575c8b592fb1dd1a708a00f787b46e6ee07b pypy2.7.tar.bz2" | sha256sum -c -
46+
RUN tar -C /opt -xj < pypy2.7.tar.bz2 && rm pypy2.7.tar.bz2
47+
RUN ln -s /opt/pypy2.7-v7.3.22-linux32/bin/pypy /usr/local/bin/pypy
48+
RUN ln -s /opt/pypy2.7-v7.3.22-linux32/bin/pypy /usr/local/bin/python
49+
RUN pypy -mensurepip
50+
RUN pypy -mpip install --upgrade pip==20.3.4
51+
RUN pypy -mpip install --upgrade setuptools wheel
52+
ADD requirements.txt /root/requirements.txt
53+
RUN pypy -mpip install --require-hashes -r /root/requirements.txt
54+
55+
# Define a user
56+
ARG BUILDWORKER_UID=1001
57+
ARG PARALLEL_BUILDS=4
58+
RUN adduser buildworker --uid=$BUILDWORKER_UID
59+
RUN echo parallel_runs=$PARALLEL_BUILDS > /home/buildworker/machine_cfg.py
60+
ENV PYPY_LOCALBASE=/usr/local
61+
USER buildworker

0 commit comments

Comments
 (0)