简体   繁体   English

主机重启后未挂载Docker卷

[英]Docker Volumes not mounted after host reboot

I start various docker containers through docker-compose up -d and they all have the restart always flags enabled. 我通过docker-compose up -d启动各种docker容器,并且它们都启用了重启始终标志。

When I reboot the host machine (Windows 10 Pro), the containers restart but it appears the volumes are not mounted. 当我重新启动主机(Windows 10 Pro)时,容器重新启动但看起来没有安装卷。 I know this because I keep the config files on the mounted volume and the services bring up the initial setup screen when I go to the webpages, plex for example does the starting new server. 我知道这是因为我将配置文件保存在已安装的卷上,当我访问网页时,服务会显示初始设置屏幕,例如plex启动新服务器。 When I run docker-compose stop , and then docker-compose up -d they have the volumes mounted and are using the correct config files. 当我运行docker-compose stop ,然后docker-compose up -d他们已经安装了卷并使用了正确的配置文件。 Is there a difference between how the containers get started on a restart versus docker-compose up ? 容器在重启时的启动方式与docker-compose up之间的区别是否存在差异?

For host-mounted volumes, it's a known problem that the volumes are not available immediately after restart: https://github.com/docker/for-win/issues/584#issuecomment-286792858 对于安装在主机上的卷,已知的问题是重新启动后卷不可立即使用: https//github.com/docker/for-win/issues/584#issuecomment-286792858

I recommend using non-host mounted volumes or other workarounds. 我建议使用非主机安装卷或其他解决方法。

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

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