Docker-py: 没法这个方法:docker.from_env().containers.list()

Created on 7 Nov 2017  Â·  1Comment  Â·  Source: docker/docker-py

这是docker版本:
Client:
Version: 17.04.0-ce
API version: 1.28
Go version: go1.7.5
Git commit: 4845c56
Built: Mon Apr 3 18:01:08 2017
OS/Arch: linux/amd64

Server:
Version: 17.04.0-ce
API version: 1.28 (minimum version 1.12)
Go version: go1.7.5
Git commit: 4845c56
Built: Mon Apr 3 18:01:08 2017
OS/Arch: linux/amd64
Experimental: false

这是docker api版本:
docker (2.5.1)
docker-py (1.10.6)
docker-pycreds (0.2.1)

python版本:Python 3.6.3

错误:
root@inner-2:~# python3.6 getdocker.py
Traceback (most recent call last):
File "getdocker.py", line 2, in
print(docker.from_env().containers.list())
AttributeError: 'function' object has no attribute 'list'

Most helpful comment

pip uninstall docker-py; pip install -U docker

>All comments

pip uninstall docker-py; pip install -U docker

Was this page helpful?
0 / 5 - 0 ratings