5
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

DockerでPostgresql 18を動かすとno such file or directory: unknownで死ぬ事象の対策

Last updated at Posted at 2025-09-28

エラー内容は下記の通り。

Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "<マウントパスまたはボリューム名>" to rootfs at "/var/lib/postgresql/data": change mount propagation through procfd: open o_path procfd: open /var/lib/docker/overlay2/xxxx/merged/var/lib/postgresql/data: no such file or directory: unknown

原因はPostgresql 18でのデータの持ち方の変化によるもの。
16等は/var/lib/postgresql/data直下にデータがあった。
18になってから/var/lib/postgresql/18/docker直下に置かれるようになった。
そのため、マウントするには/var/lib/postgresql/18/dockerに対してマウントする必要がある。

パスバインド、ボリュームバインドのいずれもマウントパスの修正で解決できる。
特にPostgresql18のコンテナで作成したデータであっても、/var/lib/postgresql/dataでマウントすることは出来ないみたいなので要注意。

5
1
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?