21
11

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【Docker For Mac】Error response from daemon: Mounts deniedの対応

Posted at

Ubuntu + MySQLの環境をDockerで構築しようとしたときにマウントエラーが起きたのでそのときの対応です。

Dockerイメージはleafney/ubuntu-mysqlを使います。

ドキュメントに書いてある通り、コマンドを実行すると以下のようなエラーになりました。

$ docker run --name mysql -v /var/docker_data/mysql/data/:/var/lib/mysql -d -p 3306:3306 leafney/ubuntu-mysql

409e6281c751d88a935fd8db84c9dadd3f0dc2da24ba7aee203036eb493b41e6
docker: Error response from daemon: Mounts denied:
The path /var/docker_data/mysql/data/
is not shared from OS X and is not known to Docker.
You can configure shared paths from Docker -> Preferences... -> File Sharing.
See https://docs.docker.com/docker-for-mac/osxfs/#namespaces for more info.

エラー内容にも書いてあるようにDocker For MacのFile Sharingに関する情報を更新する必要があります。

以下の部分にマウントするディレクトリを追加後、DockerをリスタートすればOKです。
スクリーンショット 2018-08-02 7.23.44.png

21
11
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
21
11

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?