From 75beab08e2250e9f6f99617025a429040e4c9e9b Mon Sep 17 00:00:00 2001 From: Andrew Ferrazzutti Date: Mon, 24 Mar 2025 08:42:25 -0400 Subject: [PATCH 1/2] Use uv pip to install supervisor in workers image Do this to take advantage of the cache mount for uv, and to be consistent with how base requirements are installed with uv pip. --- docker/Dockerfile-workers | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docker/Dockerfile-workers b/docker/Dockerfile-workers index 2ceb6ab67c..ccfd64ca22 100644 --- a/docker/Dockerfile-workers +++ b/docker/Dockerfile-workers @@ -26,10 +26,15 @@ FROM docker.io/library/redis:7-bookworm AS redis_base # now build the final image, based on the the regular Synapse docker image FROM $FROM - # Install supervisord with pip instead of apt, to avoid installing a second + # Install supervisord with uv pip instead of apt, to avoid installing a second # copy of python. - RUN --mount=type=cache,target=/root/.cache/pip \ - pip install supervisor~=4.2 + # --link-mode=copy silences a warning as uv isn't able to do hardlinks between its cache + # (mounted as --mount=type=cache) and the target directory. + RUN \ + --mount=type=bind,from=ghcr.io/astral-sh/uv:0.6.8,source=/uv,target=/uv \ + --mount=type=cache,target=/root/.cache/uv \ + /uv pip install --link-mode=copy --prefix="/usr/local" supervisor~=4.2 + RUN mkdir -p /etc/supervisor/conf.d # Copy over redis and nginx From 6501ba4f950dc56de8447f91d29a1629cd2f107f Mon Sep 17 00:00:00 2001 From: Andrew Ferrazzutti Date: Mon, 24 Mar 2025 12:30:17 -0400 Subject: [PATCH 2/2] Add changelog --- changelog.d/18275.docker | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/18275.docker diff --git a/changelog.d/18275.docker b/changelog.d/18275.docker new file mode 100644 index 0000000000..154226e5f6 --- /dev/null +++ b/changelog.d/18275.docker @@ -0,0 +1 @@ +Use uv pip to install supervisor in the worker image.