Skip to content

Install a postgresql-common.conf override - #1428

Open
tianon wants to merge 1 commit into
docker-library:masterfrom
infosiftr:tmpfiles.d
Open

tianon wants to merge 1 commit into
docker-library:masterfrom
infosiftr:tmpfiles.d

Conversation

@tianon

@tianon tianon commented Nov 13, 2026

Copy link
Copy Markdown
Member

This avoids the upstream behavior of resetting our carefully crafted "arbitrary user" permissions during the installation of postgresql-common -- alternatively, we could set the permissions after the install, but explicitly overriding the package behavior is cleaner.

Also, move up the creation of /run/postgresql and finally apply the /var/run -> /run conversion that both Debian and Alpine applied long ago (no longer relying on the compatibility symlink).

Fixes #1427

Comment thread Dockerfile-alpine.template Outdated
grep -F "listen_addresses = '*'" /usr/local/share/postgresql/postgresql.conf.sample

RUN install --verbose --directory --owner postgres --group postgres --mode 3777 /var/run/postgresql
RUN install --verbose --directory --owner postgres --group postgres --mode 3777 /run/postgresql

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is moved to line 18, so it is no longer needed here, right?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm so good at this. (updating)

This avoids the upstream behavior of resetting our carefully crafted "arbitrary user" permissions during the installation of `postgresql-common` -- alternatively, we could set the permissions after the install, but explicitly overriding the package behavior is cleaner.

Also, move up the creation of `/run/postgresql` and finally apply the `/var/run` -> `/run` conversion that both Debian and Alpine applied long ago (no longer relying on the compatibility symlink).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

18.7: /var/lib/postgresql is 755 instead of 1777, breaks running as an arbitrary user

2 participants