说明
docker-compose安装好之后使用报错。
docker-compose版本查看
[root@cc6-im docker-compose]# docker-compose -v
docker-compose version 1.25.0, build 0a186604
执行其他命令,报错如下
[root@cc6-im docker-compose]# docker-compose ps
ERROR:
Can't find a suitable configuration file in this directory or any
parent. Are you in the right directory?
Supported filenames: docker-compose.yml, docker-compose.yaml
需要进入有docker-compose.yml的文件目录,进入并执行,报错如下:
Traceback (most recent call last):
File "bin/docker-compose", line 6, in <module>
File "compose/cli/main.py", line 72, in main
File "compose/cli/main.py", line 125, in perform_command
File "compose/cli/command.py", line 64, in project_from_options
File "compose/cli/command.py", line 139, in get_project
File "compose/config/config.py", line 387, in load
File "compose/config/config.py", line 387, in <listcomp>
File "compose/config/config.py", line 532, in process_config_file
File "compose/config/config.py", line 229, in get_service_dicts
File "distutils/version.py", line 46, in __eq__
File "distutils/version.py", line 337, in _cmp
TypeError: '<' not supported between instances of 'str' and 'int'
[14062] Failed to execute script docker-compose
原因
版本号
version: '3'
必须是数字不能使String类型的
相关链接:
再次验证
- docker-compose ps
[root@cc6-im app]# docker-compose ps
Name Command State Ports
------------------------------
成功。
说明
本文只做学习参考,如有任何不准确的地方欢迎指正。
我的邮箱:
lulongji2011@163.com