エラー内容は下記の通り。
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でマウントすることは出来ないみたいなので要注意。