cmd in windows using docker,but has error: mkdir /host_mnt/uC: operation not permitted.
时间: 2024-05-29 17:14:37 浏览: 170
This error occurs when Docker for Windows is unable to access the directory you are trying to mount as a volume. To fix this, you need to grant Docker permissions to access the directory.
Here are the steps to do that:
1. Open Docker for Windows and go to Settings.
2. Click on "Shared Drives" and select the drive that contains the directory you are trying to mount.
3. Enter your Windows username and password to grant Docker access to the drive.
4. Click on "Apply" to save the changes.
5. Restart Docker for Windows.
After you have granted Docker access to the drive, you should be able to mount directories without any issues.
相关问题
docker mkdir /host_mnt/uC: operation not permitted.
这个错误通常是由于Docker的安全机制造成的,Docker默认使用了Linux的安全机制,其中一个重要的机制是使用了namespace技术来隔离Docker容器与宿主机的文件系统,从而保护宿主机的安全性。因此,如果你想要在Docker容器内创建宿主机的目录,需要使用Docker的-v选项来挂载宿主机的目录到Docker容器内。
例如,如果你想要在Docker容器内创建宿主机的目录“/host_mnt/uC”,可以使用以下命令:
```
docker run -it -v /host_mnt/uC:/host_mnt/uC your_image_name
```
这样就可以将宿主机的目录“/host_mnt/uC”挂载到Docker容器内的“/host_mnt/uC”目录下,从而可以在Docker容器内创建宿主机的目录。
阅读全文