这是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'
pip uninstall docker-py; pip install -U docker
Most helpful comment
pip uninstall docker-py; pip install -U docker