素肌にサスペンダー

個人的な備忘と日記

【Docker】ERROR: for 〇〇〇 Cannot start service wordpress: Mounts denied: The path ××× is not shared from the host and is not known to Docker.が出た時の対応

ローカルのファイルをマウントしようとした時に、以下のエラーが出た。 Docker側からローカルディレクトリにアクセスできる権限が無いってことだと思う。

ERROR: for 〇〇〇  Cannot start service wordpress: Mounts denied: 
The path ××× is not shared from the host and is not known to Docker.

エラーの下に続き以下の通り書いてあるまんまDockerの画面設定を変更すれば、うまく行った。

You can configure shared paths from Docker -> Preferences... -> Resources -> File Sharing.
See https://docs.docker.com/docker-for-mac for more info.
  1. Docker -> Preferences... -> Resources -> File Sharing.
  2. +アイコンをクリックし、プロジェクトのディレクトリを選択する。