Error response from daemon: invalid mount config
Dockerでボリュームマウントに失敗した場合のエラー
概要
Error response from daemon: invalid mount config は、Dockerコンテナ起動時にボリュームマウントの設定が不正な場合に発生するエラーです。
エラーメッセージ
Error response from daemon: invalid mount config for type "bind": bind source path does not exist: /path/to/source
Error response from daemon: invalid mount config for type "volume": invalid specification
docker: Error response from daemon: Mounts denied: The path /Users/... is not shared from the host
原因と解決策
1. ソースパスが存在しない
| |
2. パスの形式が間違い(Windows)
| |
3. Docker Desktopでの共有設定
Docker Desktop → Settings → Resources → File Sharing で共有ディレクトリを追加。
| |
4. 相対パスの使用
| |
5. docker-compose での設定
| |
6. 権限の問題
| |
7. SELinuxが有効な場合(Linux)
| |
8. 読み取り専用マウント
| |
デバッグ方法
| |
関連エラー
関連エラー
Docker の他のエラー
この記事は役に立ちましたか?