postgres home directory, /var/lib/postgresql, owned by root again
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 48/100
Piste de recherche
Commencez par le script d’entrypoint et reproduisez le comportement de bind-mount à l’aide du fichier compose indiqué, y compris avec un répertoire hôte nouvellement créé. Déterminez en quoi la propriété et les permissions diffèrent entre les images Alpine et Debian ; le travail est terminé lorsque l’utilisateur postgres peut utiliser son répertoire personnel sans perturber le comportement existant des volumes ni introduire une modification incompatible involontaire.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
In 18+, /var/lib/postgresql is the mount target and still the postgres user's home directory. This brings back #274 (fixed by #277) when doing a bind mount on a new directory.
I have this issue again with v18. I started over with a fresh container and newly created volumes. This is my compose file:
services: db: image: postgres:18-alpine restart: unless-stopped environment: - POSTGRES_PASSWORD=redacted - TZ=Europe/Berlin - PGTZ=Europe/Berlin volumes: - /mnt/storage/postgres-data:/var/lib/postgresql ports: - "5432:5432"
Originally posted by @dkadioglu in #274
If the local directory for the bind mount (like /mnt/storage/postgres-data) doesn't exist before doing a docker compose up, then it will be automatically created by docker as root owned. If users need the .psql_history file, then they'll need to pre-create the directory locally (or chown/chmod after) with permissions such that the postgres user of the image can use it (uid/gid 70 in Alpine; uid/gid 999 in Debian); alternatively, they can run the image as a different user (e.g. user: 1000:1000) that already has permissions to access that directory on the host.
Now that 18 has moved the volume to /var/lib/postgresql/ instead of PGDATA, then it might make sense for us to chown or chmod it in the entypoint script so that the postgres user correctly owns or can at least use their home directory. 🤔 It could be a breaking change though, so we'll have to give it some thought.
- Langage dominant
- Shell
- Étoiles
- 2.5k
- Forks
- 1.2k
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de docker-library/postgres
-
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
docker-library/postgres#1419 · 2 commentaires ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
docker-library/postgres#1389 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 35/100
docker-library/postgres#1356 · 5 commentaires · 7 réactions ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 25/100
docker-library/postgres#1355 · 10 commentaires · 11 réactions ·
-
postgres in container with PID 1 aggregating orphaned processes leading to restarts & recoveryOuverte
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
docker-library/postgres#1349 · 3 commentaires ·
Toutes les issues de docker-library/postgres
Issues similaires
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 90/100
unixorn/awesome-zsh-plugins#2285 ·
Les mainteneurs répondent en général sous 1 jour
-
documentation priority: low
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
snapotter-hq/SnapOtter#1863 ·
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
nasa-jpl/bespokebpv7#51 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
Les mainteneurs répondent en général sous 1 jour
-
area/rules
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
usnistgov/macos_security#836 ·
Les mainteneurs répondent en général sous 1 jour