Use piwheels for armv7 docker image builds (#5703)

This commit is contained in:
J. Nick Koston 2023-11-08 16:50:08 -06:00 committed by GitHub
parent cf22c55430
commit d394b957d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 7 deletions

View file

@ -14,6 +14,7 @@ FROM base-${BASEIMGTYPE} AS base
ARG TARGETARCH
ARG TARGETVARIANT
ARG PIP_EXTRA_INDEX_URL
# Note that --break-system-packages is used below because
# https://peps.python.org/pep-0668/ added a safety check that prevents
@ -46,7 +47,7 @@ RUN \
libssl-dev=3.0.11-1~deb12u2 \
libffi-dev=3.4.4-1 \
cargo=0.66.0+ds1-1 \
pkg-config=1.8.1-1; \
pkg-config=1.8.1-1 \
gcc-arm-linux-gnueabihf=4:12.2.0-3; \
fi; \
rm -rf \
@ -58,8 +59,8 @@ ENV \
# Fix click python3 lang warning https://click.palletsprojects.com/en/7.x/python3/
LANG=C.UTF-8 LC_ALL=C.UTF-8 \
# Store globally installed pio libs in /piolibs
PLATFORMIO_GLOBALLIB_DIR=/piolibs
PLATFORMIO_GLOBALLIB_DIR=/piolibs \
PIP_EXTRA_INDEX_URL=${PIP_EXTRA_INDEX_URL}
# Support legacy binaries on Debian multiarch system. There is no "correct" way
# to do this, other than using properly built toolchains...

View file

@ -143,15 +143,25 @@ def main():
imgs = [f"{params.build_to}:{tag}" for tag in tags_to_push]
imgs += [f"ghcr.io/{params.build_to}:{tag}" for tag in tags_to_push]
build_args = [
"--build-arg",
f"BASEIMGTYPE={params.baseimgtype}",
"--build-arg",
f"BUILD_VERSION={args.tag}",
]
if args.arch == ARCH_ARMV7:
build_args += [
"--build-arg",
"PIP_EXTRA_INDEX_URL=https://www.piwheels.org/simple",
]
# 3. build
cmd = [
"docker",
"buildx",
"build",
"--build-arg",
f"BASEIMGTYPE={params.baseimgtype}",
"--build-arg",
f"BUILD_VERSION={args.tag}",
*build_args,
"--cache-from",
f"type=registry,ref={cache_img}",
"--file",