From 282488dd33ef5b014f87defb94912894505afad2 Mon Sep 17 00:00:00 2001 From: tommy Date: Sat, 4 Jan 2025 00:58:27 +0000 Subject: [PATCH] Update apps/home-assistant/Dockerfile --- apps/home-assistant/Dockerfile | 52 ++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/apps/home-assistant/Dockerfile b/apps/home-assistant/Dockerfile index bec3d9a..9640031 100644 --- a/apps/home-assistant/Dockerfile +++ b/apps/home-assistant/Dockerfile @@ -12,11 +12,9 @@ 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" \ - PYTHONPATH="/config/deps" + HOME="/config" ENV UMASK="0002" \ TZ="Etc/UTC" @@ -33,7 +31,7 @@ RUN \ bluez-deprecated \ bluez-libs \ ca-certificates \ - tini \ + catatonit \ coreutils \ cups-libs \ curl \ @@ -75,37 +73,41 @@ RUN \ libxslt-dev \ postgresql-dev \ unixodbc-dev \ - && rm -rf /config/deps/orjson || true \ - && pip install uv \ - && curl -fsSL "https://github.com/home-assistant/core/archive/${VERSION}.tar.gz" \ + && \ + pip install uv \ + && \ + curl -fsSL "https://github.com/home-assistant/core/archive/${VERSION}.tar.gz" \ | tar xzf - -C /tmp --strip-components=1 \ - && HOME_ASSISTANT_BASE=$(curl -fsSL "https://raw.githubusercontent.com/home-assistant/core/${VERSION}/build.yaml" | grep "amd64: " | cut -d ":" -f3) \ - && uv pip install --only-binary=:all: --find-links "${HOMEASSISTANT_WHEELS}" \ + && \ + case "${TARGETPLATFORM}" in \ + 'linux/amd64') \ + export ARCH='amd64'; \ + ;; \ + 'linux/arm64') \ + export ARCH='aarch64'; \ + ;; \ + 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}" \ --requirement "https://raw.githubusercontent.com/home-assistant/docker/${HOME_ASSISTANT_BASE}/requirements.txt" \ - && uv pip install --only-binary=:all: --find-links "${HOMEASSISTANT_WHEELS}" \ + && \ + uv pip install --system --only-binary=:all: --find-links "${HOMEASSISTANT_WHEELS}" \ --requirement /tmp/requirements_all.txt \ - && uv pip install --only-binary=:all: --find-links "${HOMEASSISTANT_WHEELS}" \ + && \ + uv pip install --system --only-binary=:all: --find-links "${HOMEASSISTANT_WHEELS}" \ homeassistant=="${VERSION}" \ - && curl -L https://github.com/AlexxIT/go2rtc/releases/download/v1.9.8/go2rtc_linux_amd64 --output /bin/go2rtc \ - && chmod +x /bin/go2rtc \ - && mkdir -p /config \ - && uv pip install orjson --target /config/deps \ - && chown nobody:nogroup -R /config \ + && mkdir -p /config && chown nobody:nogroup -R /config \ && apk del --purge .build-deps \ && rm -rf /root/.cache /root/.cargo /tmp/* -COPY ./entrypoint.sh /entrypoint.sh - -# Ensure permissions for entrypoint -RUN chmod +x /entrypoint.sh \ - && chmod +x /sbin/tini +COPY ./apps/home-assistant/entrypoint.sh /entrypoint.sh USER nobody:nogroup WORKDIR /config VOLUME ["/config"] -ENTRYPOINT ["/sbin/tini", "--", "/entrypoint.sh"] -#ENTRYPOINT ["/usr/bin/catatonit", "--", "/entrypoint.sh"] -#CMD ["/sbin/tini", "--", "/entrypoint.sh"] +ENTRYPOINT ["/usr/bin/catatonit", "--", "/entrypoint.sh"] -LABEL org.opencontainers.image.source="https://github.com/home-assistant/core" +LABEL org.opencontainers.image.source="https://github.com/home-assistant/core" \ No newline at end of file