From 1aae0469d072a53f6c986f4be22aa61d5bf3e675 Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Fri, 27 Sep 2024 00:04:38 +0200 Subject: [PATCH 1/5] use venv for python --- Dockerfile.base | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile.base b/Dockerfile.base index 4f8e698b1..673ced8c1 100644 --- a/Dockerfile.base +++ b/Dockerfile.base @@ -35,7 +35,10 @@ RUN pip install --upgrade pip \ # Configure runtime environmental variables ENV LD_PRELOAD="/usr/lib/libjemalloc.so.2" -ENV UV_SYSTEM_PYTHON="1" + +ENV VIRTUAL_ENV=/opt/venv +RUN python3 -m venv $VIRTUAL_ENV +ENV PATH="$VIRTUAL_ENV/bin:$PATH" LABEL \ org.opencontainers.image.title="Music Assistant Base Image" \ From d0a651023aa8e49157ed3bf16b4873dab2ac928d Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Fri, 27 Sep 2024 02:47:56 +0200 Subject: [PATCH 2/5] more updates to base image --- Dockerfile.base | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Dockerfile.base b/Dockerfile.base index 673ced8c1..44aa695ef 100644 --- a/Dockerfile.base +++ b/Dockerfile.base @@ -29,16 +29,22 @@ RUN set -x \ RUN mkdir -p /usr/local/bin/widevine_cdm COPY widevine_cdm/* /usr/local/bin/widevine_cdm/ +ENV VIRTUAL_ENV=/opt/venv +RUN python3 -m venv $VIRTUAL_ENV +ENV PATH="$VIRTUAL_ENV/bin:$PATH" + # Upgrade pip + Install uv RUN pip install --upgrade pip \ - && pip install uv==0.2.27 + && pip install uv==0.2.27 \ + # install complicated dependencies (e.g. construct) + && uv pip install \ + --no-cache \ + --find-links "https://wheels.home-assistant.io/musllinux/" \ + construct[extras]==2.10.70 \ # Configure runtime environmental variables ENV LD_PRELOAD="/usr/lib/libjemalloc.so.2" -ENV VIRTUAL_ENV=/opt/venv -RUN python3 -m venv $VIRTUAL_ENV -ENV PATH="$VIRTUAL_ENV/bin:$PATH" LABEL \ org.opencontainers.image.title="Music Assistant Base Image" \ From 9618651566fd0b0753986327a8b0e5d234e0c03a Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Fri, 27 Sep 2024 02:49:45 +0200 Subject: [PATCH 3/5] cleanup --- Dockerfile.base | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Dockerfile.base b/Dockerfile.base index 44aa695ef..3d29f0677 100644 --- a/Dockerfile.base +++ b/Dockerfile.base @@ -29,6 +29,8 @@ RUN set -x \ RUN mkdir -p /usr/local/bin/widevine_cdm COPY widevine_cdm/* /usr/local/bin/widevine_cdm/ +# Configure runtime environmental variables +ENV LD_PRELOAD="/usr/lib/libjemalloc.so.2" ENV VIRTUAL_ENV=/opt/venv RUN python3 -m venv $VIRTUAL_ENV ENV PATH="$VIRTUAL_ENV/bin:$PATH" @@ -40,11 +42,7 @@ RUN pip install --upgrade pip \ && uv pip install \ --no-cache \ --find-links "https://wheels.home-assistant.io/musllinux/" \ - construct[extras]==2.10.70 \ - -# Configure runtime environmental variables -ENV LD_PRELOAD="/usr/lib/libjemalloc.so.2" - + construct[extras]==2.10.70 LABEL \ org.opencontainers.image.title="Music Assistant Base Image" \ From e8bf48397a4ac8eac7718d21e7a776f6520b3ea8 Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Fri, 27 Sep 2024 02:54:25 +0200 Subject: [PATCH 4/5] tweak --- Dockerfile.base | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile.base b/Dockerfile.base index 3d29f0677..cdd02ceee 100644 --- a/Dockerfile.base +++ b/Dockerfile.base @@ -38,11 +38,11 @@ ENV PATH="$VIRTUAL_ENV/bin:$PATH" # Upgrade pip + Install uv RUN pip install --upgrade pip \ && pip install uv==0.2.27 \ - # install complicated dependencies (e.g. construct) + # pre-install complicated dependencies (e.g. construct) to prevent oserror on docker && uv pip install \ --no-cache \ --find-links "https://wheels.home-assistant.io/musllinux/" \ - construct[extras]==2.10.70 + construct LABEL \ org.opencontainers.image.title="Music Assistant Base Image" \ From eef93e957a8521a71450c2e653a1f73b901f5bd0 Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Fri, 27 Sep 2024 03:07:40 +0200 Subject: [PATCH 5/5] include pywidevine in base image --- Dockerfile.base | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile.base b/Dockerfile.base index cdd02ceee..bdf89a2de 100644 --- a/Dockerfile.base +++ b/Dockerfile.base @@ -38,11 +38,11 @@ ENV PATH="$VIRTUAL_ENV/bin:$PATH" # Upgrade pip + Install uv RUN pip install --upgrade pip \ && pip install uv==0.2.27 \ - # pre-install complicated dependencies (e.g. construct) to prevent oserror on docker + # pre-install complicated dependencies (e.g. pywidevine) to prevent oserror on docker && uv pip install \ --no-cache \ --find-links "https://wheels.home-assistant.io/musllinux/" \ - construct + pywidevine==1.8.0 LABEL \ org.opencontainers.image.title="Music Assistant Base Image" \