From 060cbc3c8c99cc2aba13cf05016c90626974e338 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Mon, 16 Oct 2023 20:16:43 +0200 Subject: [PATCH 1/6] Pre-configure pip & s6 in base image --- Dockerfile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9f3010b51..44f147ca4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,8 +9,13 @@ ARG \ PICOTTS_HASH \ TELLDUS_COMMIT -# Add Home Assistant wheels repository -ENV WHEELS_LINKS=https://wheels.home-assistant.io/musllinux/ +# Set pip & S6 defaults +ENV \ + PIP_DISABLE_PIP_VERSION_CHECK=1 \ + PIP_EXTRA_INDEX_URL="https://wheels.home-assistant.io/musllinux-index/" + PIP_NO_CACHE_DIR=1 \ + PIP_PREFER_BINARY=1 \ + S6_SERVICES_GRACETIME=220000 ## # Install component packages @@ -42,7 +47,7 @@ RUN \ ## Install pip module for component/homeassistant COPY requirements.txt /usr/src/ RUN \ - pip3 install --no-cache-dir --no-index --only-binary=:all: --find-links "${WHEELS_LINKS}" \ + pip3 install --only-binary=:all: \ -r /usr/src/requirements.txt \ && rm -f /usr/src/requirements.txt From 16a890a7683a0005b1c2bbe9b4e9808313f00f2e Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Mon, 16 Oct 2023 22:00:04 +0200 Subject: [PATCH 2/6] Fix missing slash --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 44f147ca4..a10251ac2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ ARG \ # Set pip & S6 defaults ENV \ PIP_DISABLE_PIP_VERSION_CHECK=1 \ - PIP_EXTRA_INDEX_URL="https://wheels.home-assistant.io/musllinux-index/" + PIP_EXTRA_INDEX_URL="https://wheels.home-assistant.io/musllinux-index/" \ PIP_NO_CACHE_DIR=1 \ PIP_PREFER_BINARY=1 \ S6_SERVICES_GRACETIME=220000 From 9b0a84bd4064d07571df3adf175ba14da4b77ab9 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Tue, 17 Oct 2023 10:16:35 +0200 Subject: [PATCH 3/6] Use pip conf, to avoid issues with passing along env vars --- Dockerfile | 15 +++++---------- rootfs/etc/pip.conf | 5 +++++ 2 files changed, 10 insertions(+), 10 deletions(-) create mode 100644 rootfs/etc/pip.conf diff --git a/Dockerfile b/Dockerfile index a10251ac2..30a5d5305 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,13 +9,6 @@ ARG \ PICOTTS_HASH \ TELLDUS_COMMIT -# Set pip & S6 defaults -ENV \ - PIP_DISABLE_PIP_VERSION_CHECK=1 \ - PIP_EXTRA_INDEX_URL="https://wheels.home-assistant.io/musllinux-index/" \ - PIP_NO_CACHE_DIR=1 \ - PIP_PREFER_BINARY=1 \ - S6_SERVICES_GRACETIME=220000 ## # Install component packages @@ -43,6 +36,10 @@ RUN \ pulseaudio-alsa \ socat +### +# Base S6-Overlay +COPY rootfs / + #### ## Install pip module for component/homeassistant COPY requirements.txt /usr/src/ @@ -149,6 +146,4 @@ RUN \ /usr/src/telldus \ /usr/src/telldus-fix-gcc-11-issues.patch \ /usr/src/telldus-fix-alpine-3-17-issues.patch -### -# Base S6-Overlay -COPY rootfs / + diff --git a/rootfs/etc/pip.conf b/rootfs/etc/pip.conf new file mode 100644 index 000000000..0fb57b689 --- /dev/null +++ b/rootfs/etc/pip.conf @@ -0,0 +1,5 @@ +[global] +disable-pip-version-check = true +extra-index-url=https://wheels.home-assistant.io/musllinux-index/ +no-cache-dir = false +prefer-binary = true From 3d64f330d37db75647eb41d5e4117177a4caded3 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Tue, 17 Oct 2023 10:21:53 +0200 Subject: [PATCH 4/6] Adjust handolint --- .hadolint.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.hadolint.yaml b/.hadolint.yaml index 7a1c98cc1..9128753db 100644 --- a/.hadolint.yaml +++ b/.hadolint.yaml @@ -1,7 +1,6 @@ ignored: - DL3003 - DL3006 - - DL3013 - DL3018 + - DL3042 - SC2155 - - SC2046 From ba938873eb2c63442917c2dbfeeeac8b0f4b659d Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Tue, 17 Oct 2023 10:25:52 +0200 Subject: [PATCH 5/6] Styling --- rootfs/etc/pip.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rootfs/etc/pip.conf b/rootfs/etc/pip.conf index 0fb57b689..b34373a35 100644 --- a/rootfs/etc/pip.conf +++ b/rootfs/etc/pip.conf @@ -1,5 +1,5 @@ [global] disable-pip-version-check = true -extra-index-url=https://wheels.home-assistant.io/musllinux-index/ +extra-index-url = https://wheels.home-assistant.io/musllinux-index/ no-cache-dir = false prefer-binary = true From 7345a2fb428cb7cfd63c5a335392136dcc565af9 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Wed, 18 Oct 2023 15:52:25 +0200 Subject: [PATCH 6/6] Adjust based on upstream base images changes --- Dockerfile | 8 +++----- rootfs/etc/pip.conf | 5 ----- 2 files changed, 3 insertions(+), 10 deletions(-) delete mode 100644 rootfs/etc/pip.conf diff --git a/Dockerfile b/Dockerfile index 30a5d5305..c5170cffe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,6 @@ ARG \ PICOTTS_HASH \ TELLDUS_COMMIT - ## # Install component packages RUN \ @@ -36,10 +35,6 @@ RUN \ pulseaudio-alsa \ socat -### -# Base S6-Overlay -COPY rootfs / - #### ## Install pip module for component/homeassistant COPY requirements.txt /usr/src/ @@ -147,3 +142,6 @@ RUN \ /usr/src/telldus-fix-gcc-11-issues.patch \ /usr/src/telldus-fix-alpine-3-17-issues.patch +### +# Base S6-Overlay +COPY rootfs / diff --git a/rootfs/etc/pip.conf b/rootfs/etc/pip.conf deleted file mode 100644 index b34373a35..000000000 --- a/rootfs/etc/pip.conf +++ /dev/null @@ -1,5 +0,0 @@ -[global] -disable-pip-version-check = true -extra-index-url = https://wheels.home-assistant.io/musllinux-index/ -no-cache-dir = false -prefer-binary = true