Help us understand the problem. What is going on with this article?

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

More than 1 year has passed since last update.

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

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした