Skip to content

Commit 13fe2a9

Browse files
authored
Reorder Dockerfile to improve caching (#138789)
1 parent df50863 commit 13fe2a9

File tree

2 files changed

+36
-36
lines changed

2 files changed

+36
-36
lines changed

Dockerfile

Lines changed: 18 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

script/hassfest/docker.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,24 @@
2626
2727
ARG QEMU_CPU
2828
29+
# Home Assistant S6-Overlay
30+
COPY rootfs /
31+
32+
# Needs to be redefined inside the FROM statement to be set for RUN commands
33+
ARG BUILD_ARCH
34+
# Get go2rtc binary
35+
RUN \
36+
case "${{BUILD_ARCH}}" in \
37+
"aarch64") go2rtc_suffix='arm64' ;; \
38+
"armhf") go2rtc_suffix='armv6' ;; \
39+
"armv7") go2rtc_suffix='arm' ;; \
40+
*) go2rtc_suffix=${{BUILD_ARCH}} ;; \
41+
esac \
42+
&& curl -L https://github.com/AlexxIT/go2rtc/releases/download/v{go2rtc}/go2rtc_linux_${{go2rtc_suffix}} --output /bin/go2rtc \
43+
&& chmod +x /bin/go2rtc \
44+
# Verify go2rtc can be executed
45+
&& go2rtc --version
46+
2947
# Install uv
3048
RUN pip3 install uv=={uv}
3149
@@ -56,24 +74,6 @@
5674
&& python3 -m compileall \
5775
homeassistant/homeassistant
5876
59-
# Home Assistant S6-Overlay
60-
COPY rootfs /
61-
62-
# Needs to be redefined inside the FROM statement to be set for RUN commands
63-
ARG BUILD_ARCH
64-
# Get go2rtc binary
65-
RUN \
66-
case "${{BUILD_ARCH}}" in \
67-
"aarch64") go2rtc_suffix='arm64' ;; \
68-
"armhf") go2rtc_suffix='armv6' ;; \
69-
"armv7") go2rtc_suffix='arm' ;; \
70-
*) go2rtc_suffix=${{BUILD_ARCH}} ;; \
71-
esac \
72-
&& curl -L https://github.com/AlexxIT/go2rtc/releases/download/v{go2rtc}/go2rtc_linux_${{go2rtc_suffix}} --output /bin/go2rtc \
73-
&& chmod +x /bin/go2rtc \
74-
# Verify go2rtc can be executed
75-
&& go2rtc --version
76-
7777
WORKDIR /config
7878
"""
7979

0 commit comments

Comments
 (0)