エラーの内容
postgresqlのコンテナを立ち上げようとしたら、、、
Error response from daemon: Mounts denied:
The path /home/containers/postgresql is not shared from the host and is not known to Docker.
You can configure shared paths from Docker -> Preferences... -> Resources -> File Sharing.
See https://docs.docker.com/desktop/settings/mac/#file-sharing for more info.
こんな感じのエラーがでた。
docker desktopの設定からfile sharingの設定ができるみたいだがうまくいかなかったので困った。
解決策
docker-compose.ymlの中身を書き換えた。
修正前
services:
db:
volumes:
- /home/containers/postgresql:/var/lib/postgresql/data
修正後
services:
db:
volumes:
- ./data:/var/lib/postgresql/data
そして postgresqlのディレクトリで以下を実行
$ mkdir -p ./data
これでなんとかupすることができた。