首页 > 解决方案 > 如何在 Windows 中使用绑定挂载运行 docker?

问题描述

请注意:

C:\work\azure-voting-app-redis [master ≡ +1 ~1 -0 !]> docker run -it tiangolo/uwsgi-nginx-flask:python3.6 --mount 'type=bind,source=c:\work\azure-voting-app-redis\azure-vote\ca-certs,target=/ca-certs' bash
/entrypoint.sh: 46: exec: --mount: not found
C:\work\azure-voting-app-redis [master ≡ +1 ~1 -0 !]>

我要做的就是在将本地目录安装到容器中时从给定的图像运行 bash。该错误不是很有帮助。

我在 Windows 上的 powershell 控制台中运行它。

我在做什么错(除了在 Windows 上运行它)?

标签: windowsdockermount

解决方案


愚蠢的我。我的命令行不正确。我之前应该提到--mount-it,像这样:

docker run  --mount 'type=bind,source=c:\work\azure-voting-app-redis\azure-vote\ca-certs,target=/ca-certs' -it tiangolo/uwsgi-nginx-flask:python3.6 bash

推荐阅读