docker-compose不在CentOS 7上运行

问题描述 投票:0回答:1

运行docker-compose -f docker/common/docker-compose.yml up时出现错误:

Traceback (most recent call last):
  File "/usr/bin/docker-compose", line 5, in <module>
    from compose.cli.main import main
  File "/usr/lib/python2.7/site-packages/compose/cli/main.py", line 18, in <module>
    import docker.errors
  File "/usr/lib/python2.7/site-packages/docker/__init__.py", line 2, in <module>
    from .api import APIClient
  File "/usr/lib/python2.7/site-packages/docker/api/__init__.py", line 2, in <module>
    from .client import APIClient
  File "/usr/lib/python2.7/site-packages/docker/api/client.py", line 5, in <module>
    import requests
  File "/usr/lib/python2.7/site-packages/requests/__init__.py", line 43, in <module>
    import urllib3
  File "/usr/lib/python2.7/site-packages/urllib3/__init__.py", line 10, in <module>
    from .connectionpool import (
  File "/usr/lib/python2.7/site-packages/urllib3/connectionpool.py", line 31, in <module>
    from .connection import (
  File "/usr/lib/python2.7/site-packages/urllib3/connection.py", line 45, in <module>
    from .util.ssl_ import (
  File "/usr/lib/python2.7/site-packages/urllib3/util/__init__.py", line 4, in <module>
    from .request import make_headers

Python版本:Python 2.7.5

上面的命令过去在最新的系统更新之前可以正常工作。


UPDATE

将Python升级到3.x,然后将docker-compose升级到最新版本解决了此问题。

docker docker-compose centos7
1个回答
1
投票
用于python 2.7的docker Compose项目具有End of life

请将系统python更新到3.X并安装最新版本的docker compose

© www.soinside.com 2019 - 2024. All rights reserved.