Python lib庫docker-py和docker的區別


1)兩者的安裝方式

pip install docker

A Python library for the Docker Engine API
pip install docker-py
A Python library for the Docker Remote API.

2)兩者的區別
In this repository, we use docker-py (in requirements.txt, or in Dockerfile-alpine).
This is older package, last version 1.10.6 on pypi is from 2016-11-02.
The newer package is called docker (newest ver. 2.2.1 from 2017-03-28).
Besides the ambiguous name, docker package is incompatible with docker-py.
在這個存儲庫中,我們使用docker-py(在requirements.txt中,或在Dockerfile-alpine中)。
這是較舊的軟件包,pypi的最新版本1.10.6是2016-11-02。
較新的包稱為docker(2017-03-28最新版本2.2.1)。
除了模糊的名稱,docker包與docker-py不兼容。

 

the breaking changes (and new features) from version 1.10.6 (docker-py) to 2.0.0 (docker) can be found at docker-py documentation.
The relevant changes, I think, are:
從版本1.10.6(docker-py)到2.0.0(docker)的重大更改(和新功能)可以在docker-py文檔中找到。
我認為相關的變化是:
docker.Client has been renamed to docker.APIClient
docker.from_env now creates a DockerClient instance instead of an APIClient instance
create_host_config, create_ipam_pool and create_ipam_config have been removed from docker.utils.
They have been replaced by the following classes in docker.types: HostConfig, IPAMPool and IPAMCOnfig.
(new feature) Added a high-level, user-focused API as docker.DockerClient
docker.Client已重命名為docker.APIClient
docker.from_env現在創建一個DockerClient實例而不是APIClient實例
已從docker.utils中刪除create_host_config,create_ipam_pool和create_ipam_config。
它們已被docker.types中的以下類替換:HostConfig,IPAMPool和IPAMCOnfig。
(新功能)添加了一個高級的,以用戶為中心的API作為docker.DockerClient


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM