执行docker-compose up报错

HTY_Rui 2022-07-20 14:18:56

   编写好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/)有没有大佬帮忙孩子吧

...全文
911 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
CSDN-Ada助手 2023-01-13
  • 打赏
  • 举报
回复
您可以前往 CSDN问答-开发工具 发布问题, 以便更快地解决您的疑问

1,163

社区成员

发帖
与我相关
我的任务
社区描述
Docker是一个开源的应用容器引擎,让开发者可以打包他们的应用以及依赖包到一个可移植的容器中,然后发布到任何流行的Linux 机器上,也可以实现虚拟化。
社区管理员
  • Docker
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧