mirror of
https://github.com/esphome/esphome.git
synced 2024-11-29 02:04:13 +01:00
commit
9d453f0ba2
4 changed files with 38 additions and 27 deletions
|
@ -5,6 +5,7 @@
|
||||||
# One of "docker", "hassio"
|
# One of "docker", "hassio"
|
||||||
ARG BASEIMGTYPE=docker
|
ARG BASEIMGTYPE=docker
|
||||||
|
|
||||||
|
|
||||||
# https://github.com/hassio-addons/addon-debian-base/releases
|
# https://github.com/hassio-addons/addon-debian-base/releases
|
||||||
FROM ghcr.io/hassio-addons/debian-base:7.2.0 AS base-hassio
|
FROM ghcr.io/hassio-addons/debian-base:7.2.0 AS base-hassio
|
||||||
# https://hub.docker.com/_/debian?tab=tags&page=1&name=bookworm
|
# https://hub.docker.com/_/debian?tab=tags&page=1&name=bookworm
|
||||||
|
@ -12,9 +13,10 @@ FROM debian:12.2-slim AS base-docker
|
||||||
|
|
||||||
FROM base-${BASEIMGTYPE} AS base
|
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
|
||||||
|
@ -59,8 +61,7 @@ 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...
|
||||||
|
@ -72,7 +73,11 @@ RUN \
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
# Ubuntu python3-pip is missing wheel
|
# Ubuntu python3-pip is missing wheel
|
||||||
pip3 install --break-system-packages --no-cache-dir \
|
if [ "$TARGETARCH$TARGETVARIANT" = "armv7" ]; then \
|
||||||
|
export PIP_EXTRA_INDEX_URL="https://www.piwheels.org/simple"; \
|
||||||
|
fi; \
|
||||||
|
pip3 install \
|
||||||
|
--break-system-packages --no-cache-dir \
|
||||||
platformio==6.1.11 \
|
platformio==6.1.11 \
|
||||||
# Change some platformio settings
|
# Change some platformio settings
|
||||||
&& platformio settings set enable_telemetry No \
|
&& platformio settings set enable_telemetry No \
|
||||||
|
@ -84,8 +89,12 @@ RUN \
|
||||||
# tmpfs is for https://github.com/rust-lang/cargo/issues/8719
|
# tmpfs is for https://github.com/rust-lang/cargo/issues/8719
|
||||||
|
|
||||||
COPY requirements.txt requirements_optional.txt script/platformio_install_deps.py platformio.ini /
|
COPY requirements.txt requirements_optional.txt script/platformio_install_deps.py platformio.ini /
|
||||||
RUN --mount=type=tmpfs,target=/root/.cargo CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse CARGO_HOME=/root/.cargo \
|
RUN --mount=type=tmpfs,target=/root/.cargo if [ "$TARGETARCH$TARGETVARIANT" = "armv7" ]; then \
|
||||||
pip3 install --break-system-packages --no-cache-dir -r /requirements.txt -r /requirements_optional.txt \
|
export PIP_EXTRA_INDEX_URL="https://www.piwheels.org/simple"; \
|
||||||
|
fi; \
|
||||||
|
CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse CARGO_HOME=/root/.cargo \
|
||||||
|
pip3 install \
|
||||||
|
--break-system-packages --no-cache-dir -r /requirements.txt -r /requirements_optional.txt \
|
||||||
&& /platformio_install_deps.py /platformio.ini --libraries
|
&& /platformio_install_deps.py /platformio.ini --libraries
|
||||||
|
|
||||||
|
|
||||||
|
@ -94,7 +103,11 @@ FROM base AS docker
|
||||||
|
|
||||||
# Copy esphome and install
|
# Copy esphome and install
|
||||||
COPY . /esphome
|
COPY . /esphome
|
||||||
RUN pip3 install --break-system-packages --no-cache-dir --no-use-pep517 -e /esphome
|
RUN if [ "$TARGETARCH$TARGETVARIANT" = "armv7" ]; then \
|
||||||
|
export PIP_EXTRA_INDEX_URL="https://www.piwheels.org/simple"; \
|
||||||
|
fi; \
|
||||||
|
pip3 install \
|
||||||
|
--break-system-packages --no-cache-dir --no-use-pep517 -e /esphome
|
||||||
|
|
||||||
# Settings for dashboard
|
# Settings for dashboard
|
||||||
ENV USERNAME="" PASSWORD=""
|
ENV USERNAME="" PASSWORD=""
|
||||||
|
@ -140,7 +153,11 @@ COPY docker/ha-addon-rootfs/ /
|
||||||
|
|
||||||
# Copy esphome and install
|
# Copy esphome and install
|
||||||
COPY . /esphome
|
COPY . /esphome
|
||||||
RUN pip3 install --break-system-packages --no-cache-dir --no-use-pep517 -e /esphome
|
RUN if [ "$TARGETARCH$TARGETVARIANT" = "armv7" ]; then \
|
||||||
|
export PIP_EXTRA_INDEX_URL="https://www.piwheels.org/simple"; \
|
||||||
|
fi; \
|
||||||
|
pip3 install \
|
||||||
|
--break-system-packages --no-cache-dir --no-use-pep517 -e /esphome
|
||||||
|
|
||||||
# Labels
|
# Labels
|
||||||
LABEL \
|
LABEL \
|
||||||
|
@ -176,7 +193,11 @@ RUN \
|
||||||
/var/lib/apt/lists/*
|
/var/lib/apt/lists/*
|
||||||
|
|
||||||
COPY requirements_test.txt /
|
COPY requirements_test.txt /
|
||||||
RUN pip3 install --break-system-packages --no-cache-dir -r /requirements_test.txt
|
RUN if [ "$TARGETARCH$TARGETVARIANT" = "armv7" ]; then \
|
||||||
|
export PIP_EXTRA_INDEX_URL="https://www.piwheels.org/simple"; \
|
||||||
|
fi; \
|
||||||
|
pip3 install \
|
||||||
|
--break-system-packages --no-cache-dir -r /requirements_test.txt
|
||||||
|
|
||||||
VOLUME ["/esphome"]
|
VOLUME ["/esphome"]
|
||||||
WORKDIR /esphome
|
WORKDIR /esphome
|
||||||
|
|
|
@ -143,25 +143,15 @@ 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_args,
|
"--build-arg",
|
||||||
|
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",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"""Constants used by esphome."""
|
"""Constants used by esphome."""
|
||||||
|
|
||||||
__version__ = "2023.11.0b2"
|
__version__ = "2023.11.0b3"
|
||||||
|
|
||||||
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
|
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
|
||||||
VALID_SUBSTITUTIONS_CHARACTERS = (
|
VALID_SUBSTITUTIONS_CHARACTERS = (
|
||||||
|
|
|
@ -10,8 +10,8 @@ platformio==6.1.11 # When updating platformio, also update Dockerfile
|
||||||
esptool==4.6.2
|
esptool==4.6.2
|
||||||
click==8.1.7
|
click==8.1.7
|
||||||
esphome-dashboard==20231107.0
|
esphome-dashboard==20231107.0
|
||||||
aioesphomeapi==18.2.4
|
aioesphomeapi==18.2.7
|
||||||
zeroconf==0.120.0
|
zeroconf==0.122.3
|
||||||
|
|
||||||
# esp-idf requires this, but doesn't bundle it by default
|
# esp-idf requires this, but doesn't bundle it by default
|
||||||
# https://github.com/espressif/esp-idf/blob/220590d599e134d7a5e7f1e683cc4550349ffbf8/requirements.txt#L24
|
# https://github.com/espressif/esp-idf/blob/220590d599e134d7a5e7f1e683cc4550349ffbf8/requirements.txt#L24
|
||||||
|
|
Loading…
Reference in a new issue