【Docker】initdb: error: directory "/var/lib/postgresql/data" exists but is not empty が解決できない

お聞きしたいこと

下記、Dockerのエラーが解決できず困っております。
Dockerに詳しい方ご教授いただけますと幸いです。

2022-11-17 18:16:42 The files belonging to this database system will be owned by user "postgres". 2022-11-17 18:16:42 This user must also own the server process. 2022-11-17 18:16:42 2022-11-17 18:16:42 The database cluster will be initialized with locale "en_US.utf8". 2022-11-17 18:16:42 The default database encoding has accordingly been set to "UTF8". 2022-11-17 18:16:42 The default text search configuration will be set to "english". 2022-11-17 18:16:42 2022-11-17 18:16:42 Data page checksums are disabled. 2022-11-17 18:16:42 2022-11-17 18:16:42 initdb: error: directory "/var/lib/postgresql/data" exists but is not empty 2022-11-17 18:16:42 If you want to create a new database system, either remove or empty 2022-11-17 18:16:42 the directory "/var/lib/postgresql/data" or run initdb 2022-11-17 18:16:42 with an argument other than "/var/lib/postgresql/data".

試したこと

  • docker-composeでPostgreSQL作成時の注意を参考に/var/lib/postgresql/dataに階層を追加しました。
    • できるだけ階層は加えず解消したいので、/var/lib/postgresql/dataにあるデータを削除する方針で解決したいと思い、下記を実行。
  • コンテナ、イメージ、キャッシュを全削除し、localのプロジェクトディレクトリを削除→再度クローンしました。

コメントを投稿

0 コメント