Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
11
Help us understand the problem. What is going on with this article?

More than 1 year has passed since last update.

@nishina555

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

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

11
Help us understand the problem. What is going on with this article?
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
11
Help us understand the problem. What is going on with this article?