diff --git a/changelog.d/19107.misc b/changelog.d/19107.misc new file mode 100644 index 0000000000..38cb9a9b3b --- /dev/null +++ b/changelog.d/19107.misc @@ -0,0 +1 @@ +Prevent uv `/usr/local/.lock` file from appearing in built Synapse docker images. \ No newline at end of file diff --git a/docker/Dockerfile b/docker/Dockerfile index f83486036d..6d10dee1aa 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -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