From 0892bf0c75f6a9c34c5679a7eec532c32812197c Mon Sep 17 00:00:00 2001 From: Jory Irving Date: Thu, 7 Nov 2024 08:32:42 -0700 Subject: [PATCH] fix(home-assistant): Disable UV cache, add go2rtc, Use explicit go2rtc version, set PYTHONPATH --- apps/home-assistant/Dockerfile | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/apps/home-assistant/Dockerfile b/apps/home-assistant/Dockerfile index 4c6fa55..24b5d9b 100644 --- a/apps/home-assistant/Dockerfile +++ b/apps/home-assistant/Dockerfile @@ -19,9 +19,11 @@ ENV \ PIP_DISABLE_PIP_VERSION_CHECK=1 \ PIP_BREAK_SYSTEM_PACKAGES=1 \ UV_SYSTEM_PYTHON=true \ + UV_NO_CACHE=true \ CRYPTOGRAPHY_DONT_BUILD_RUST=1 \ HOMEASSISTANT_WHEELS="https://wheels.home-assistant.io/musllinux/" \ - HOME="/config" + HOME="/config" \ + PYTHONPATH="/config/deps" ENV UMASK="0002" \ TZ="Etc/UTC" @@ -45,6 +47,7 @@ RUN \ eudev-libs \ ffmpeg \ git \ + go2rtc \ iputils \ jo \ jq \ @@ -90,22 +93,26 @@ RUN \ case "${TARGETPLATFORM}" in \ 'linux/amd64') \ export ARCH='amd64'; \ + export GO2RTC_SUFFIX='amd64'; \ ;; \ 'linux/arm64') \ export ARCH='aarch64'; \ + export GO2RTC_SUFFIX='arm64'; \ ;; \ esac \ && \ HOME_ASSISTANT_BASE=$(curl -fsSL "https://raw.githubusercontent.com/home-assistant/core/${VERSION}/build.yaml" | grep "${ARCH}: " | cut -d ":" -f3) \ && \ - uv pip install --system --only-binary=:all: --find-links "${HOMEASSISTANT_WHEELS}" \ + uv pip install --only-binary=:all: --find-links "${HOMEASSISTANT_WHEELS}" \ --requirement "https://raw.githubusercontent.com/home-assistant/docker/${HOME_ASSISTANT_BASE}/requirements.txt" \ && \ - uv pip install --system --only-binary=:all: --find-links "${HOMEASSISTANT_WHEELS}" \ + uv pip install --only-binary=:all: --find-links "${HOMEASSISTANT_WHEELS}" \ --requirement /tmp/requirements_all.txt \ && \ - uv pip install --system --only-binary=:all: --find-links "${HOMEASSISTANT_WHEELS}" \ + uv pip install --only-binary=:all: --find-links "${HOMEASSISTANT_WHEELS}" \ homeassistant=="${VERSION}" \ + && curl -L https://github.com/AlexxIT/go2rtc/releases/download/v1.9.6/go2rtc_linux_${GO2RTC_SUFFIX} --output /bin/go2rtc \ + && chmod +x /bin/go2rtc \ && mkdir -p /config && chown nobody:nogroup -R /config \ && apk del --purge .build-deps \ && rm -rf /root/.cache /root/.cargo /tmp/*