[英]Docker (for Windows) does not mount volume
I'm trying to mount a directory with configuration files in my docker-compose.yml. 我正在尝试在docker-compose.yml中安装包含配置文件的目录。
In my case it is logstash, which tells me the mounted directory is empty. 在我的情况下,它是logstash,它告诉我挂载的目录是空的。 Loading a bash and
ls -la
in the parent directory shows that the pipeline
directory is empty and is owned by root. 在父目录中加载bash和
ls -la
显示pipeline
目录为空并且由root拥有。
One weird thing is, that it worked a few days ago. 一个奇怪的是,它几天前就有用了。
docker-compose.yml: 泊坞窗,compose.yml:
version: '3'
services:
logstash:
image: docker.elastic.co/logstash/logstash:5.6.3
ports:
- 5000:5000
- 8989:8989
volumes:
- C:/PROJECT_DIR/config/logstash/pipeline/:/usr/share/logstash/pipeline/
I found it better to try around with docker
itself, as it gives more feedback 我发现尝试使用
docker
本身更好,因为它提供了更多反馈
docker run --rm -it -v C:/PROJECT_DIR/config/logstash/pipeline/:/usr/share/logstash/pipeline/ docker.elastic.co/logstash/logstash:5.6.3
From here and some googling I found out I had to reset my shared drives credentials under "Docker for Windows" -> Settings... -> Shared Drives, because I had changed my windows domain user password. 从这里和一些谷歌搜索我发现我必须重置我的共享驱动器凭据在“Docker for Windows” - >设置... - >共享驱动器,因为我已经更改了我的Windows域用户密码。
If you changed your system username or password then you need to re-apply the credentials to get the volume mount working. 如果您更改了系统用户名或密码,则需要重新应用凭据才能使卷装置正常工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.