Update apps/home-assistant/Dockerfile

This commit is contained in:
Tommy 2025-01-04 00:09:01 +00:00
parent 4c89ad441f
commit d9f90b7ecf
Signed by: Mooo[bot]
GPG key ID: CF3AFE4D5B62BB9A

View file

@ -16,15 +16,14 @@ ENV \
CRYPTOGRAPHY_DONT_BUILD_RUST=1 \ CRYPTOGRAPHY_DONT_BUILD_RUST=1 \
HOMEASSISTANT_WHEELS="https://wheels.home-assistant.io/musllinux/" \ HOMEASSISTANT_WHEELS="https://wheels.home-assistant.io/musllinux/" \
HOME="/config" \ HOME="/config" \
PYTHONPATH="/config/deps" PYTHONPATH="/config/deps" \
UMASK="0002" \
ENV UMASK="0002" \
TZ="Etc/UTC" TZ="Etc/UTC"
USER root USER root
WORKDIR /app WORKDIR /app
#hadolint ignore=DL3018,DL3013,DL3059,DL4006 # hadolint ignore=DL3018,DL3013,DL3059,DL4006
RUN \ RUN \
apk add --no-cache \ apk add --no-cache \
bash \ bash \
@ -33,8 +32,7 @@ RUN \
bluez-deprecated \ bluez-deprecated \
bluez-libs \ bluez-libs \
ca-certificates \ ca-certificates \
catatonit \ tini \ # <--- Install Tini here
tini \
coreutils \ coreutils \
cups-libs \ cups-libs \
curl \ curl \
@ -77,9 +75,9 @@ RUN \
postgresql-dev \ postgresql-dev \
unixodbc-dev \ unixodbc-dev \
&& \ && \
rm -rf /config/deps/orjson || true \ pip install uv \
&& \ && \
pip install uv orjson \ uv pip install orjson \
&& \ && \
curl -fsSL "https://github.com/home-assistant/core/archive/${VERSION}.tar.gz" \ curl -fsSL "https://github.com/home-assistant/core/archive/${VERSION}.tar.gz" \
| tar xzf - -C /tmp --strip-components=1 \ | tar xzf - -C /tmp --strip-components=1 \
@ -94,25 +92,26 @@ RUN \
&& \ && \
uv pip install --only-binary=:all: --find-links "${HOMEASSISTANT_WHEELS}" \ uv pip install --only-binary=:all: --find-links "${HOMEASSISTANT_WHEELS}" \
homeassistant=="${VERSION}" \ homeassistant=="${VERSION}" \
&& curl -L https://github.com/AlexxIT/go2rtc/releases/download/v1.9.8/go2rtc_linux_amd64 --output /bin/go2rtc \ && \
&& chmod +x /bin/go2rtc \ curl -L https://github.com/AlexxIT/go2rtc/releases/download/v1.9.8/go2rtc_linux_amd64 --output /bin/go2rtc \
&& mkdir -p /config && chown nobody:nogroup -R /config \ && \
&& apk del --purge .build-deps \ chmod +x /bin/go2rtc \
&& rm -rf /root/.cache /root/.cargo /tmp/* && \
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 COPY ./entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Ensure permissions for entrypoint # Switch to a non-root user, if desired
RUN chmod +x /entrypoint.sh \
&& chmod +x /usr/bin/catatonit \
&& chmod +x /sbin/tini
USER nobody:nogroup USER nobody:nogroup
WORKDIR /config WORKDIR /config
VOLUME ["/config"] VOLUME ["/config"]
# Use tini as fallback if catatonit fails # Use Tini as the init system
ENTRYPOINT ["/usr/bin/catatonit", "--", "/entrypoint.sh"] ENTRYPOINT ["/sbin/tini", "--", "/entrypoint.sh"]
CMD ["/sbin/tini", "--", "/entrypoint.sh"]
LABEL org.opencontainers.image.source="https://github.com/home-assistant/core" LABEL org.opencontainers.image.source="https://github.com/home-assistant/core"