------------------------------------------------------------------------
[root@localhost core]# pip install docker-py
// After install docker-py, CORE is abnormal, so, uninstall it.
[root@localhost core]# pip uninstall docker-py
[root@localhost ~]# pip uninstall docker-py
You are using pip version 7.1.0, however version 8.1.1 is available.
You should consider upgrading via the ‘pip install --upgrade pip‘ command.
Uninstalling docker-py-1.8.1:
/usr/lib/python2.7/site-packages/docker/__init__.py
/usr/lib/python2.7/site-packages/docker/__init__.pyc
......
/usr/lib/python2.7/site-packages/docker_py-1.8.1.dist-info/metadata.json
/usr/lib/python2.7/site-packages/docker_py-1.8.1.dist-info/top_level.txt
Proceed (y/n)?
---------------------------- 用了一个星期的时间,排除了种种可能出错的原因,终于找到了错误根源
---------------------------- /usr/lib/python2.7/site-packages/core/services/dockersvc.py: client = Client(version=‘1.10‘)
修改为 /usr/lib/python2.7/site-packages/core/services/dockersvc.py: client = Client(version=‘1.12‘)
因为
# tail /var/log/core-daemon.log APIError: 400 Client Error: Bad Request ("client version 1.10 is too old. Minimum supported API version is 1.12, please upgrade your client to a newer version")
[root@localhost docker-py-master]# make
docker build -t docker-py .
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
Makefile:11: recipe for target ‘build‘ failed
make: *** [build] Error 1
[root@localhost docker-py-master]# pip install docker-py
You are using pip version 7.1.0, however version 8.1.1 is available.
You should consider upgrading via the ‘pip install --upgrade pip‘ command.
Collecting docker-py
Using cached docker_py-1.8.1-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): backports.ssl-match-hostname>=3.5 in /usr/lib/python2.7/site-packages (from docker-py)
Requirement already satisfied (use --upgrade to upgrade): ipaddress>=1.0.16 in /usr/lib/python2.7/site-packages (from docker-py)
Requirement already satisfied (use --upgrade to upgrade): requests>=2.5.2 in /usr/lib/python2.7/site-packages (from docker-py)
Requirement already satisfied (use --upgrade to upgrade): six>=1.4.0 in /usr/lib/python2.7/site-packages (from docker-py)
Requirement already satisfied (use --upgrade to upgrade): websocket-client>=0.32.0 in /usr/lib/python2.7/site-packages (from docker-py)
Requirement already satisfied (use --upgrade to upgrade): urllib3==1.15.1 in /usr/lib/python2.7/site-packages (from requests>=2.5.2->docker-py)
Installing collected packages: docker-py
Successfully installed docker-py-1.8.1
[root@localhost docker-py-master]# pip freeze | grep docker-py
You are using pip version 7.1.0, however version 8.1.1 is available.
You should consider upgrading via the ‘pip install --upgrade pip‘ command.
docker-py==1.8.1
[root@localhost docker-py-master]# pip freeze | grep docker-py && python --version && docker version
You are using pip version 7.1.0, however version 8.1.1 is available.
You should consider upgrading via the ‘pip install --upgrade pip‘ command.
docker-py==1.8.1
Python 2.7.11
Client:
Version: 1.11.1
API version: 1.23
Go version: go1.5.4
Git commit: 5604cbe
Built: Wed Apr 27 00:57:43 2016
OS/Arch: linux/amd64