Exclude .lock file from /usr/local when building docker images (#19107)

This commit is contained in:
Andrew Morgan
2025-10-30 11:17:35 +01:00
committed by GitHub
parent e0838c2567
commit 728512918e
2 changed files with 7 additions and 1 deletions

1
changelog.d/19107.misc Normal file
View File

@@ -0,0 +1 @@
Prevent uv `/usr/local/.lock` file from appearing in built Synapse docker images.

View File

@@ -179,7 +179,12 @@ LABEL org.opencontainers.image.licenses='AGPL-3.0-or-later OR LicenseRef-Element
COPY --from=runtime-deps /install-${TARGETARCH}/etc /etc
COPY --from=runtime-deps /install-${TARGETARCH}/usr /usr
COPY --from=runtime-deps /install-${TARGETARCH}/var /var
COPY --from=builder /install /usr/local
# Copy the installed python packages from the builder stage.
#
# uv will generate a `.lock` file when installing packages, which we don't want
# to copy to the final image.
COPY --from=builder --exclude=.lock /install /usr/local
COPY ./docker/start.py /start.py
COPY ./docker/conf /conf