0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Error response from daemon: Mounts deniedというエラーの解決策

Posted at

エラーの内容

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することができた。

0
0
0

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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?