mirror of
https://github.com/esphome/esphome.git
synced 2024-11-28 12:46:22 +01:00
Use piwheels for armv7 docker image builds (#5703)
This commit is contained in:
parent
cf22c55430
commit
d394b957d1
@ -14,6 +14,7 @@ FROM base-${BASEIMGTYPE} AS base
|
|||||||
|
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
ARG TARGETVARIANT
|
ARG TARGETVARIANT
|
||||||
|
ARG PIP_EXTRA_INDEX_URL
|
||||||
|
|
||||||
# Note that --break-system-packages is used below because
|
# Note that --break-system-packages is used below because
|
||||||
# https://peps.python.org/pep-0668/ added a safety check that prevents
|
# https://peps.python.org/pep-0668/ added a safety check that prevents
|
||||||
@ -46,7 +47,7 @@ RUN \
|
|||||||
libssl-dev=3.0.11-1~deb12u2 \
|
libssl-dev=3.0.11-1~deb12u2 \
|
||||||
libffi-dev=3.4.4-1 \
|
libffi-dev=3.4.4-1 \
|
||||||
cargo=0.66.0+ds1-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; \
|
gcc-arm-linux-gnueabihf=4:12.2.0-3; \
|
||||||
fi; \
|
fi; \
|
||||||
rm -rf \
|
rm -rf \
|
||||||
@ -58,8 +59,8 @@ ENV \
|
|||||||
# Fix click python3 lang warning https://click.palletsprojects.com/en/7.x/python3/
|
# Fix click python3 lang warning https://click.palletsprojects.com/en/7.x/python3/
|
||||||
LANG=C.UTF-8 LC_ALL=C.UTF-8 \
|
LANG=C.UTF-8 LC_ALL=C.UTF-8 \
|
||||||
# Store globally installed pio libs in /piolibs
|
# 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
|
# Support legacy binaries on Debian multiarch system. There is no "correct" way
|
||||||
# to do this, other than using properly built toolchains...
|
# to do this, other than using properly built toolchains...
|
||||||
|
@ -143,15 +143,25 @@ def main():
|
|||||||
imgs = [f"{params.build_to}:{tag}" for tag in tags_to_push]
|
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]
|
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
|
# 3. build
|
||||||
cmd = [
|
cmd = [
|
||||||
"docker",
|
"docker",
|
||||||
"buildx",
|
"buildx",
|
||||||
"build",
|
"build",
|
||||||
"--build-arg",
|
*build_args,
|
||||||
f"BASEIMGTYPE={params.baseimgtype}",
|
|
||||||
"--build-arg",
|
|
||||||
f"BUILD_VERSION={args.tag}",
|
|
||||||
"--cache-from",
|
"--cache-from",
|
||||||
f"type=registry,ref={cache_img}",
|
f"type=registry,ref={cache_img}",
|
||||||
"--file",
|
"--file",
|
||||||
|
Loading…
Reference in New Issue
Block a user