18.7: /var/lib/postgresql is 755 instead of 1777, breaks running as an arbitrary user
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- docker, postgresql
- Domain
- databases
Research direction
Start by reading the Dockerfile section that sets /var/lib/postgresql to mode 1777 and the issue’s description of postgresql-common’s tmpfiles configuration and post-install step. Build and run the Debian-based postgres:18.7 image as an arbitrary UID, checking the directory mode and whether startup succeeds. Done means the directory remains usable by an arbitrary UID and the container starts successfully.
Written by the indexing model from the issue text.
Description
We noticed this when our CI broke after postgres:18 moved to 18.7. We run the image as a service container on OpenShift, which starts it with an arbitrary UID, and it now exits at once:
$ docker run --rm --user 1000770000:0 -e POSTGRES_PASSWORD=x postgres:18.7
mkdir: cannot create directory ‘/var/lib/postgresql/18’: Permission denied
/var/lib/postgresql was 1777 and is now 755:
$ docker run --rm --entrypoint stat postgres:18.6 -c %a /var/lib/postgresql
1777
$ docker run --rm --entrypoint stat postgres:18.7 -c %a /var/lib/postgresql
755
It looks like postgresql-common 294 resets it: it now ships /usr/lib/tmpfiles.d/postgresql-common.conf with d /var/lib/postgresql 0755 postgres postgres, and its postinst runs systemd-tmpfiles --create, after the Dockerfile's install --mode 1777. The alpine variant still has 1777.
- Dominant language
- Shell
- Stars
- 2.5k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from docker-library/postgres
-
Difficulty 1/5 1-3 hours Newbie friendliness 80/100
docker-library/postgres#1425 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
docker-library/postgres#1420 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
docker-library/postgres#1419 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
docker-library/postgres#1389 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
docker-library/postgres#1356 · 5 comments · 7 reactions ·
All issues in docker-library/postgres
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
raetha/wyzesense2mqtt#116 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 62/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
catppuccin/tmux#608 ·
-
area:linux source:reader type:content-error
Difficulty 1/5 Under an hour Newbie friendliness 72/100
stephrobert/blog-roadmap#185 ·