Skip to content

Commit 5c84f25

Browse files
authored
complement-synapse: COPY existing dir from base (#18294)
The base postgres image already has the /var/run/postgresql directory, and COPY can set file ownership with chown=, so COPY it instead of making it from scratch & manually setting its ownership. ### Pull Request Checklist <!-- Please read https://element-hq.github.io/synapse/latest/development/contributing_guide.html before submitting your pull request --> * [x] Pull request is based on the develop branch * [x] Pull request includes a [changelog file](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#changelog). The entry should: - Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from `EventStore` to `EventWorkerStore`.". - Use markdown where necessary, mostly for `code blocks`. - End with either a period (.) or an exclamation mark (!). - Start with a capital letter. - Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry. * [x] [Code style](https://element-hq.github.io/synapse/latest/code_style.html) is correct (run the [linters](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#run-the-linters))
1 parent 7707686 commit 5c84f25

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

changelog.d/18294.docker

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Optimize the build of the complement-synapse image.

docker/complement/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ FROM $FROM
2525
RUN adduser --system --uid 999 postgres --home /var/lib/postgresql
2626
COPY --from=postgres_base /usr/lib/postgresql /usr/lib/postgresql
2727
COPY --from=postgres_base /usr/share/postgresql /usr/share/postgresql
28-
RUN mkdir /var/run/postgresql && chown postgres /var/run/postgresql
28+
COPY --from=postgres_base --chown=postgres /var/run/postgresql /var/run/postgresql
2929
ENV PATH="${PATH}:/usr/lib/postgresql/13/bin"
3030
ENV PGDATA=/var/lib/postgresql/data
3131

0 commit comments

Comments
 (0)