1,177
社区成员
发帖
与我相关
我的任务
分享
编写好docker-compose.yml文件之后,执行docker-compose up命令报错:
[root@localhost]# docker-compose up
ERROR: The Compose file './docker-compose.yml' is invalid because:
services.elasticsearch.environment contains an invalid type, it should be an object, or an array
'kibana', 'logstash' do not match any of the regexes: '^x-'
You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version (e.g "2.2" or "3.3") and place your service definitions under the `services` key, or omit the `version` key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/
[root@localhost]# docker-compose version #docker-compose的版本
docker-compose version 1.29.2, build 5becea4c
docker-py version: 5.0.0
CPython version: 3.7.10
OpenSSL version: OpenSSL 1.1.0l 10 Sep 2019
[root@localhost]# docker -v #docker engine的版本
Docker version 20.10.17, build 100c701
docker-compose.yml中我使用的version: "3.8"。自己也在网上也找了找原因,但都是说docker-compose与docker engine的版本不兼容导致的,但我根据docker官网来看我的版本是没有问题的呀。(https://docs.docker.com/compose/compose-file/compose-file-v3/)有没有大佬帮忙孩子吧