2015-01-01 203 views
5

泊塢窗-PY 0.7.0讓我對當地的碼頭工人安裝泊塢窗1.3.2 和下面的錯誤搬運工-PY 0.7.0。運行的CentOS 6.6主機IST。這可怎麼固定?搬運工-PY:客戶端和服務器不具有相同的版本(客戶端:1.16,服務器:1.15)「)

[email protected] myproject]$ bin/python d.py 
Traceback (most recent call last): 
    File "d.py", line 3, in <module> 
    c.create_container(image='zopyx/xmldirector-plone') 
    File "/home/xxxx/sandboxes/myproject/lib/python2.7/site-packages/docker/client.py", line 546, in create_container 
    return self.create_container_from_config(config, name) 
    File "/home/xxxx/sandboxes/myproject/lib/python2.7/site-packages/docker/client.py", line 554, in create_container_from_config 
    return self._result(res, True) 
    File "/home/xxxx/sandboxes/myproject/lib/python2.7/site-packages/docker/client.py", line 98, in _result 
    self._raise_for_status(response) 
    File "/home/xxxx/sandboxes/myproject/lib/python2.7/site-packages/docker/client.py", line 94, in _raise_for_status 
    raise errors.APIError(e, response, explanation=explanation) 
docker.errors.APIError: 404 Client Error: Not Found ("client and server don't have same version (client : 1.16, server: 1.15)") 

>>docker --version 
Docker version 1.3.2, build 39fa2fa/1.3.2 


>>docker version 
Client version: 1.3.2 
Client API version: 1.15 
Go version (client): go1.3.3 
Git commit (client): 39fa2fa/1.3.2 
OS/Arch (client): linux/amd64 
Server version: 1.3.2 
Server API version: 1.15 
Go version (server): go1.3.3 
Git commit (server): 39fa2fa/1.3.2 

回答

2

昨天得到了同樣的問題。強制安裝搬運工-PY = 0.6.0。如果你已經有0.7.0安裝後,你需要清除PIP緩存,否則PIP會從緩存中安裝0.7.0。

乾杯, W¯¯

1

解決方案,如果客戶端版本低於服務器版本更新:

說你想連接到您的搬運工服務是這樣的:

docker_client = Client(base_url='tcp://127.0.0.1:2376') 
# Alternatively: 
# docker_client = Client(base_url='unix://var/run/docker.sock') 

如果客戶端版本比服務器版本更新,這會導致如下錯誤消息:

docker.errors.NotFound: 404 Client Error: 
Not Found ("client and server don't have same version (client : 1.22, server: 1.18)") 

可以解決通過設置docker.Client對象的version property問題(如@sredni建議的)。鑑於上述錯誤,則需要行更改爲:

docker_client = Client(base_url='tcp://127.0.0.1:2376', version='1.18')