gpt4 book ai didi

Docker Compose/无效,因为

转载 作者:行者123 更新时间:2023-12-02 21:02:42 27 4
gpt4 key购买 nike

我想运行 docker-compose.yaml 文件,但出现以下错误:

"invalid because: services.eventstore.volumes contains an invalid type, it should be an array".



我备份了 eventstore文件到我的 Windows 桌面,我想使用 docker 恢复它。

这是我的 docker-compose 文件:
version: '3'
services:
eventstore:
image: eventstore/eventstore:release-5.0.1
container_name: eventstore
ports:
- 2113:2113
- 1113:1113
restart: always
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:2113/stats || exit 1"]
interval: 5s
timeout: 2s
environment:
- EVENTSTORE_RUN_PROJECTIONS=all
- EVENTSTORE_START_STANDARD_PROJECTIONS=TRUE
volumes:
-C:/Users/cerdem/Desktop/eventstore:./data
-C:/Users/cerdem/Desktop/eventstore:./logs


有关更多信息,我在输入 volumes 后得到了错误信息部分,因为我无法理解那部分,我将从 local 恢复 db 文件不是 host .

我的电脑运行的是windows 1O。

最佳答案

您需要在卷键中的破折号后有空格。

    volumes:
- C:/Users/cerdem/Desktop/eventstore:./data
- C:/Users/cerdem/Desktop/eventstore:./logs

它不被识别为数组。因此,类型错误。

"invalid because: services.eventstore.volumes contains an invalid type, it should be an array"



这是完整版:
services:
eventstore:
image: eventstore/eventstore:release-5.0.1
container_name: eventstore
ports:
- 2113:2113
- 1113:1113
restart: always
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:2113/stats || exit 1"]
interval: 5s
timeout: 2s
environment:
- EVENTSTORE_RUN_PROJECTIONS=all
- EVENTSTORE_START_STANDARD_PROJECTIONS=TRUE
volumes:
- C:/Users/cerdem/Desktop/eventstore:./data
- C:/Users/cerdem/Desktop/eventstore:./logs

关于Docker Compose/无效,因为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59694978/

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