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

オープン 初心者向け
#1,427 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
docker, postgresql
領域
databases

調査の方向性

まず、/var/lib/postgresql のモードを 1777 に設定する Dockerfile のセクションと、postgresql-common の tmpfiles 設定およびインストール後の手順について記載された issue の説明を読んでください。Debian ベースの postgres:18.7 イメージを任意の UID でビルドして実行し、ディレクトリのモードと起動が成功するかを確認してください。ディレクトリが任意の UID で引き続き使用でき、コンテナが正常に起動すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Shell
スター
2.5k
フォーク
1.2k
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

docker-library/postgres のほかの issue

docker-library/postgres の issue をすべて見る

似ている issue

Shell/Bash の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。