1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Docker Desktop】bind mountのパスが二重になり invalid volume specification エラーが出る場合の解決策

1
Last updated at Posted at 2026-04-01

症状

docker compose up を実行すると以下のエラーが出てコンテナが起動しない

Error response from daemon: invalid volume specification: 
'/host_mnt/Users/yourname/project:/config:/config:rw'

docker-compose.yml

volumes:
  - ./config:/container/config

原因

Docker Desktop for MacのデフォルトのファイルシステムドライバーであるVirtioFSが、相対パスを誤って解釈するバグ。プロジェクトルートに /host_mnt プレフィックスを付けた上で相対パス部分を二重に連結してしまう。

解決策

Docker Desktop → Settings → General → Virtual Machine Options → ファイル共有方式を osxfs (Legacy) に変更 → Apply & Restart

image.png

これで相対パスが正しく解釈されるようになる。

備考

  • Docker for Macで断続的に報告されている既知のバグ(#4859#7245
  • osxfsはVirtioFSより低速だが安定性は高い
  • Docker Desktop v29 / Compose v5環境で確認
1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?