gpt4 book ai didi

Docker-compose 卷路径在编辑后不会改变

转载 作者:行者123 更新时间:2023-12-02 19:20:46 26 4
gpt4 key购买 nike

我正在运行 docker-compose up -d我收到以下错误消息:

Creating webserver ... 
Creating webserver ... error

ERROR: for webserver Cannot start service webserver: error while mounting volume '/var/lib/docker/volumes/backend_dhparam/_data': failed to mount local volume: mount /home/root/SemanaOMnistack/backend/dhparam/:/var/lib/docker/volumes/backend_dhparam/_data, flags: 0x1000: no such file or directory

ERROR: for webserver Cannot start service webserver: error while mounting volume '/var/lib/docker/volumes/backend_dhparam/_data': failed to mount local volume: mount /home/root/SemanaOMnistack/backend/dhparam/:/var/lib/docker/volumes/backend_dhparam/_data, flags: 0x1000: no such file or directory
ERROR: Encountered errors while bringing up the project.

我在 docker-compose.yml 中的卷路径曾是:
volumes:
certbot-etc:
certbot-var:
dhparam:
driver: local
driver_opts:
type: none
device: /home/root/SemanaOMnistack/backend/dhparam/
o: bind

没关系,路径错误,我修复了它创建一个新用户并更改 docker-compose.yml 中的音量:
volumes:
certbot-etc:
certbot-var:
dhparam:
driver: local
driver_opts:
type: none
device: /home/leo/dev-maps/backend/dhparam/
o: bind

当我跑 docker-compose up -d --build中指定的卷路径撰写相同的错误消息:
Creating webserver ... 
Creating webserver ... error

ERROR: for webserver Cannot start service webserver: error while mounting volume '/var/lib/docker/volumes/backend_dhparam/_data': failed to mount local volume: mount /home/root/SemanaOMnistack/backend/dhparam/:/var/lib/docker/volumes/backend_dhparam/_data, flags: 0x1000: no such file or directory

ERROR: for webserver Cannot start service webserver: error while mounting volume '/var/lib/docker/volumes/backend_dhparam/_data': failed to mount local volume: mount /home/root/SemanaOMnistack/backend/dhparam/:/var/lib/docker/volumes/backend_dhparam/_data, flags: 0x1000: no such file or directory
ERROR: Encountered errors while bringing up the project.

我尝试了一切,如 docker system prune -a并清除我的 Docker 的所有缓存,并显示相同的错误消息!

我只是解决了将卷的名称更改为 dhparam2所以......问题不是路径而是缓存。

有谁知道如何解决它?

最佳答案

我有时在 docker-compose 中安装卷时遇到类似的问题,这些问题一直对我有用:

docker-compose down -v --remove-orphans

docker-compose up -d -V --build --force-recreate

请使用 --help更详细地了解每个标志的作用。希望这对你有用!

关于Docker-compose 卷路径在编辑后不会改变,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60031832/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com