Skip to content

Commit 3e43950

Browse files
committed
feat: Added image for Linux ARMv7 for IDF Python wheels repo
1 parent 5f20ff2 commit 3e43950

File tree

2 files changed

+146
-0
lines changed

2 files changed

+146
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Build and push Docker image 'idf-python-wheels'
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- 'idf_python_wheels/**'
9+
- '.github/workflows/build_image_idf_python_wheels.yml'
10+
11+
pull_request:
12+
paths:
13+
- 'idf_python_wheels/**'
14+
- '.github/workflows/build_image_idf_python_wheels.yml'
15+
16+
env:
17+
IMAGE_DIR: ./idf_python_wheels
18+
IMAGE_NAME: ghcr.io/${{ github.repository }}/idf-python-wheels-armv7l
19+
IMAGE_TAG: v1
20+
IMAGE_ARCHS: linux/armv7l
21+
22+
jobs:
23+
create-docker-image:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v6
28+
29+
- name: Set up QEMU
30+
uses: docker/setup-qemu-action@v3
31+
32+
- name: Set up Docker Buildx
33+
uses: docker/setup-buildx-action@v3
34+
35+
- name: Login to GHRC
36+
uses: docker/login-action@v3
37+
with:
38+
registry: ghcr.io
39+
username: ${{github.actor}}
40+
password: ${{secrets.GITHUB_TOKEN}}
41+
42+
- name: Build and push image
43+
uses: docker/build-push-action@v6
44+
with:
45+
context: ${{env.IMAGE_DIR}}
46+
platforms: ${{env.IMAGE_ARCHS}}
47+
tags: ${{env.IMAGE_NAME}}:${{env.IMAGE_TAG}}
48+
# Push package to registry only when merged to master
49+
push: ${{ github.event_name != 'pull_request' }}
50+
cache-from: type=gha
51+
cache-to: type=gha,mode=max

idf_python_wheels/Dockerfile

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# Minimal manylinux-compatible Docker image for ARMv7l (32-bit ARM)
2+
# Based on Debian Bookworm for broad compatibility
3+
4+
FROM arm32v7/debian:bookworm
5+
6+
LABEL maintainer="Espressif Systems"
7+
LABEL description="Minimal manylinux-compatible environment for building Python wheels on ARMv7l"
8+
9+
# Set environment variables
10+
ENV DEBIAN_FRONTEND=noninteractive \
11+
LC_ALL=C.UTF-8 \
12+
LANG=C.UTF-8
13+
14+
# Install build dependencies and Python versions
15+
RUN apt-get update && apt-get install -y \
16+
# Build essentials
17+
build-essential \
18+
gcc \
19+
g++ \
20+
make \
21+
cmake \
22+
git \
23+
wget \
24+
curl \
25+
ca-certificates \
26+
patchelf \
27+
# Python build dependencies
28+
libssl-dev \
29+
libffi-dev \
30+
libbz2-dev \
31+
libreadline-dev \
32+
libsqlite3-dev \
33+
libncurses5-dev \
34+
libncursesw5-dev \
35+
libgdbm-dev \
36+
liblzma-dev \
37+
tk-dev \
38+
zlib1g-dev \
39+
# Additional libraries commonly needed for wheels
40+
libxml2-dev \
41+
libxslt1-dev \
42+
libyaml-dev \
43+
libglib2.0-dev \
44+
# PyGObject dependencies
45+
libcairo2-dev \
46+
pkg-config \
47+
libgirepository1.0-dev \
48+
# dbus-python dependencies
49+
libdbus-1-dev \
50+
libdbus-glib-1-dev \
51+
# Pillow dependencies
52+
libjpeg-dev \
53+
libpng-dev \
54+
libtiff-dev \
55+
libfreetype6-dev \
56+
liblcms2-dev \
57+
libwebp-dev \
58+
libopenjp2-7-dev \
59+
libfribidi-dev \
60+
libharfbuzz-dev \
61+
libxcb1-dev \
62+
libxau-dev \
63+
brotli \
64+
libbrotli-dev \
65+
# Python from Debian repos (Bookworm provides 3.11)
66+
python3 \
67+
python3-dev \
68+
python3-venv \
69+
python3-pip \
70+
&& rm -rf /var/lib/apt/lists/*
71+
72+
# Install pip and wheel tools
73+
# --break-system-packages is OK because it is docker image and not a system
74+
RUN python3 -m pip install --no-cache-dir --break-system-packages --upgrade \
75+
pip \
76+
setuptools \
77+
wheel \
78+
auditwheel
79+
80+
# Set up manylinux platform tag
81+
# This makes auditwheel recognize the environment as manylinux-compatible
82+
# Bookworm has glibc 2.36, so we use manylinux_2_35
83+
RUN echo "manylinux_2_35_armv7l" > /etc/system-release-cpe
84+
85+
# Create a marker file for manylinux detection
86+
RUN mkdir -p /opt/python && \
87+
echo "manylinux_2_35_armv7l" > /opt/python/PLATFORM
88+
89+
# Set working directory
90+
WORKDIR /workspace
91+
92+
# Default Python
93+
ENV PATH="/usr/bin:${PATH}"
94+
95+
CMD ["/bin/bash"]

0 commit comments

Comments
 (0)