mirror of
https://github.com/home-assistant/core.git
synced 2025-05-01 20:57:51 +00:00
Improve hassfest docker image (#125133)
* Improve hassfest docker image * Use fixed uv version * Use cli params instead env * run hassfest * Exclude pycache
This commit is contained in:
parent
6ecc5c19a2
commit
6cea6be4a7
@ -69,7 +69,7 @@ WORKDIR /config
|
|||||||
_HASSFEST_TEMPLATE = r"""# Automatically generated by hassfest.
|
_HASSFEST_TEMPLATE = r"""# Automatically generated by hassfest.
|
||||||
#
|
#
|
||||||
# To update, run python3 -m script.hassfest -p docker
|
# To update, run python3 -m script.hassfest -p docker
|
||||||
FROM python:alpine3.20
|
FROM python:alpine
|
||||||
|
|
||||||
ENV \
|
ENV \
|
||||||
UV_SYSTEM_PYTHON=true \
|
UV_SYSTEM_PYTHON=true \
|
||||||
@ -79,20 +79,17 @@ SHELL ["/bin/sh", "-o", "pipefail", "-c"]
|
|||||||
ENTRYPOINT ["/usr/src/homeassistant/script/hassfest/docker/entrypoint.sh"]
|
ENTRYPOINT ["/usr/src/homeassistant/script/hassfest/docker/entrypoint.sh"]
|
||||||
WORKDIR "/github/workspace"
|
WORKDIR "/github/workspace"
|
||||||
|
|
||||||
# Install uv
|
|
||||||
COPY --from=ghcr.io/astral-sh/uv:{uv} /uv /bin/uv
|
|
||||||
|
|
||||||
COPY . /usr/src/homeassistant
|
COPY . /usr/src/homeassistant
|
||||||
|
|
||||||
RUN \
|
# Uv is only needed during build
|
||||||
|
RUN --mount=from=ghcr.io/astral-sh/uv:{uv},source=/uv,target=/bin/uv \
|
||||||
# Required for PyTurboJPEG
|
# Required for PyTurboJPEG
|
||||||
apk add --no-cache libturbojpeg \
|
apk add --no-cache libturbojpeg \
|
||||||
&& cd /usr/src/homeassistant \
|
|
||||||
&& uv pip install \
|
&& uv pip install \
|
||||||
--no-build \
|
--no-build \
|
||||||
--no-cache \
|
--no-cache \
|
||||||
-c homeassistant/package_constraints.txt \
|
-c /usr/src/homeassistant/homeassistant/package_constraints.txt \
|
||||||
-r requirements.txt \
|
-r /usr/src/homeassistant/requirements.txt \
|
||||||
stdlib-list==0.10.0 pipdeptree=={pipdeptree} tqdm=={tqdm} ruff=={ruff} \
|
stdlib-list==0.10.0 pipdeptree=={pipdeptree} tqdm=={tqdm} ruff=={ruff} \
|
||||||
{required_components_packages}
|
{required_components_packages}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# Automatically generated by hassfest.
|
# Automatically generated by hassfest.
|
||||||
#
|
#
|
||||||
# To update, run python3 -m script.hassfest -p docker
|
# To update, run python3 -m script.hassfest -p docker
|
||||||
FROM python:alpine3.20
|
FROM python:alpine
|
||||||
|
|
||||||
ENV \
|
ENV \
|
||||||
UV_SYSTEM_PYTHON=true \
|
UV_SYSTEM_PYTHON=true \
|
||||||
@ -11,20 +11,17 @@ SHELL ["/bin/sh", "-o", "pipefail", "-c"]
|
|||||||
ENTRYPOINT ["/usr/src/homeassistant/script/hassfest/docker/entrypoint.sh"]
|
ENTRYPOINT ["/usr/src/homeassistant/script/hassfest/docker/entrypoint.sh"]
|
||||||
WORKDIR "/github/workspace"
|
WORKDIR "/github/workspace"
|
||||||
|
|
||||||
# Install uv
|
|
||||||
COPY --from=ghcr.io/astral-sh/uv:0.2.27 /uv /bin/uv
|
|
||||||
|
|
||||||
COPY . /usr/src/homeassistant
|
COPY . /usr/src/homeassistant
|
||||||
|
|
||||||
RUN \
|
# Uv is only needed during build
|
||||||
|
RUN --mount=from=ghcr.io/astral-sh/uv:0.2.27,source=/uv,target=/bin/uv \
|
||||||
# Required for PyTurboJPEG
|
# Required for PyTurboJPEG
|
||||||
apk add --no-cache libturbojpeg \
|
apk add --no-cache libturbojpeg \
|
||||||
&& cd /usr/src/homeassistant \
|
|
||||||
&& uv pip install \
|
&& uv pip install \
|
||||||
--no-build \
|
--no-build \
|
||||||
--no-cache \
|
--no-cache \
|
||||||
-c homeassistant/package_constraints.txt \
|
-c /usr/src/homeassistant/homeassistant/package_constraints.txt \
|
||||||
-r requirements.txt \
|
-r /usr/src/homeassistant/requirements.txt \
|
||||||
stdlib-list==0.10.0 pipdeptree==2.23.1 tqdm==4.66.4 ruff==0.6.2 \
|
stdlib-list==0.10.0 pipdeptree==2.23.1 tqdm==4.66.4 ruff==0.6.2 \
|
||||||
PyTurboJPEG==1.7.5 ha-ffmpeg==3.2.0 hassil==1.7.4 home-assistant-intents==2024.8.29 mutagen==1.47.0
|
PyTurboJPEG==1.7.5 ha-ffmpeg==3.2.0 hassil==1.7.4 home-assistant-intents==2024.8.29 mutagen==1.47.0
|
||||||
|
|
||||||
|
@ -6,3 +6,6 @@
|
|||||||
!script/
|
!script/
|
||||||
script/hassfest/docker/
|
script/hassfest/docker/
|
||||||
!script/hassfest/docker/entrypoint.sh
|
!script/hassfest/docker/entrypoint.sh
|
||||||
|
|
||||||
|
# Temporary files
|
||||||
|
**/__pycache__
|
Loading…
x
Reference in New Issue
Block a user