简体   繁体   English

如何在 Windows 中使用绑定安装运行 docker?

[英]How to run docker with bind mount in windows?

Please, observe:请注意:

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 !]>

All I am trying to do is run bash from the given image while mounting a local directory into the container.我想要做的就是从给定的图像运行 bash,同时将本地目录安装到容器中。 The error is not very helpful.该错误不是很有帮助。

I am running it on Windows in a powershell console.我在 Windows 上的 powershell 控制台中运行它。

What am I doing wrong (besides running it on Windows) ?我做错了什么(除了在 Windows 上运行)?

Stupid me.愚蠢的我。 My command line was incorrect.我的命令行不正确。 I should have mentioned --mount before -it , like this:我应该提到--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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM