我执行了命令
docker-compose down
并收到此错误
Traceback (most recent call last):
File "bin/docker-compose", line 3, in <module>
File "compose/cli/main.py", line 68, in main
File "compose/cli/main.py", line 115, in perform_command
File "compose/cli/command.py", line 37, in project_from_options
File "compose/cli/command.py", line 91, in get_project
File "compose/config/config.py", line 362, in load
File "compose/config/config.py", line 528, in process_config_file
File "compose/config/validation.py", line 378, in
validate_against_config_schema
File "compose/config/validation.py", line 439, in handle_errors
File "compose/config/validation.py", line 439, in <genexpr>
File "compose/config/validation.py", line 365, in
process_config_schema_errors
File "compose/config/validation.py", line 237, in handle_generic_error
File "compose/config/validation.py", line 305, in
_parse_oneof_validator
File "compose/config/validation.py", line 320, in
_parse_oneof_validator
File "compose/config/validation.py", line 285, in
_parse_valid_types_from_validator
File "compose/config/validation.py", line 201, in anglicize_json_type
e
AttributeError: 'bool' object has no attribute 'startswith'
Failed to execute script docker-compose
我不知道发生了什么事,昨天一切都很好,然后今天出错,没有任何理由。
Docker version 17.06.0-ce, build 02c1d87
docker-compose version 1.14.0, build c7bdf9
答案 0 :(得分:1)
pip freeze | grep docker
并且看到我在Python中有docker,docker-compose,docker-py包,但我仍然在系统(Ubuntu)中有docker,docker-compose。也许他们在某处造成了一些冲突。 所以我在python中卸载了所有docker,docker-related-packages。
之后,我停止在docker中运行的所有容器(不再使用docker-compose down,我使用了互联网上的一些命令),删除了几乎所有的容器&#39;配置,再次运行docker-compose。它有效。
所以我添加了透视容器&#39;配置,当将Nginx容器的配置添加到docker-compose.yml时,问题再次出现。所以我改变了nginx的配置,问题解决了
答案 1 :(得分:0)
我在Windows 10计算机上安装Docker Toolbox时遇到了同样的错误。
我的解决方案:
1)安装Docker Community Edition(不是Docker Toolbox)
下载网站= https://www.docker.com/community-edition
2)启用Hyper-V
打开控制面板 - &gt;系统和安全 - &gt;程序(左图) - &gt;打开或关闭Windows功能 - &gt;检查Hyper-V框
3)将C:\ Program Files \ Docker \ Docker \ resources \ bin添加到环境变量中的Path。
4)打开Git Bash并键入&#34; docker-compose up&#34;现在该命令应该工作。 如果你没有GitBash,请下载它。