Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/build_image_idf_python_wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build and push Docker image 'idf-python-wheels'

on:
push:
branches:
- master
paths:
- 'idf_python_wheels/**'
- '.github/workflows/build_image_idf_python_wheels.yml'

pull_request:
paths:
- 'idf_python_wheels/**'
- '.github/workflows/build_image_idf_python_wheels.yml'

env:
IMAGE_DIR: ./idf_python_wheels
IMAGE_NAME: ghcr.io/${{ github.repository }}/idf-python-wheels-armv7l
IMAGE_TAG: v1
IMAGE_ARCHS: linux/arm

jobs:
create-docker-image:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GHRC
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}

- name: Build and push image
uses: docker/build-push-action@v6
with:
context: ${{env.IMAGE_DIR}}
platforms: ${{env.IMAGE_ARCHS}}
tags: ${{env.IMAGE_NAME}}:${{env.IMAGE_TAG}}
# Push package to registry only when merged to master
push: ${{ github.event_name != 'pull_request' }}
cache-from: type=gha
cache-to: type=gha,mode=max
95 changes: 95 additions & 0 deletions idf_python_wheels/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Minimal manylinux-compatible Docker image for ARMv7l (32-bit ARM)
# Based on Debian Bookworm for broad compatibility

FROM debian:bookworm

LABEL maintainer="Espressif Systems"
LABEL description="Minimal manylinux-compatible environment for building Python wheels on ARMv7l"

# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive \
LC_ALL=C.UTF-8 \
LANG=C.UTF-8

# Install build dependencies and Python versions
RUN apt-get update && apt-get install -y \
# Build essentials
build-essential \
gcc \
g++ \
make \
cmake \
git \
wget \
curl \
ca-certificates \
patchelf \
# Python build dependencies
libssl-dev \
libffi-dev \
libbz2-dev \
libreadline-dev \
libsqlite3-dev \
libncurses5-dev \
libncursesw5-dev \
libgdbm-dev \
liblzma-dev \
tk-dev \
zlib1g-dev \
# Additional libraries commonly needed for wheels
libxml2-dev \
libxslt1-dev \
libyaml-dev \
libglib2.0-dev \
# PyGObject dependencies
libcairo2-dev \
pkg-config \
libgirepository1.0-dev \
# dbus-python dependencies
libdbus-1-dev \
libdbus-glib-1-dev \
# Pillow dependencies
libjpeg-dev \
libpng-dev \
libtiff-dev \
libfreetype6-dev \
liblcms2-dev \
libwebp-dev \
libopenjp2-7-dev \
libfribidi-dev \
libharfbuzz-dev \
libxcb1-dev \
libxau-dev \
brotli \
libbrotli-dev \
# Python from Debian repos (Bookworm provides 3.11)
python3 \
python3-dev \
python3-venv \
python3-pip \
&& rm -rf /var/lib/apt/lists/*

# Install pip and wheel tools
# --break-system-packages is OK because it is docker image and not a system
RUN python3 -m pip install --no-cache-dir --break-system-packages --upgrade \
pip \
setuptools \
wheel \
auditwheel

# Set up manylinux platform tag
# This makes auditwheel recognize the environment as manylinux-compatible
# Bookworm has glibc 2.36, so we use manylinux_2_35
RUN echo "manylinux_2_35_armv7l" > /etc/system-release-cpe

# Create a marker file for manylinux detection
RUN mkdir -p /opt/python && \
echo "manylinux_2_35_armv7l" > /opt/python/PLATFORM

# Set working directory
WORKDIR /workspace

# Default Python
ENV PATH="/usr/bin:${PATH}"

CMD ["/bin/bash"]