lowel/docker-api-php-sdk
最新稳定版本:2.1.0
Composer 安装命令:
composer require lowel/docker-api-php-sdk
包简介
Docker Engine API PHP SDK
README 文档
README
Installation
Current library was tested on docker 1.51 api version!
composer require lowel/docker-api-php-sdk
Supported clients
SDK support:
- Manual PSR-7 client;
- Manual response handler, that return DTO objects (looks Lowel\Docker\Response\DTO) instead of ResponseInterface and throw some of the custom exceptions from Lowel\Docker\Exceptions;
- Async client, based on Guzzle library, return promises;
- Async response handler, same as manual response handler, but return type is promises.
You can init all clients use Lowel\Docker\ClientFactory:
$clientFactory = new \Lowel\Docker\ClientFactory(); $client = $clientFactory->getClient(); $clientWithHandler = $clientFactory->getClientWithHandler(); $asyncClient = $clientFactory->getAsyncClient(); $asyncClientWithHandler = $clientFactory->getAsyncClientWithHandler(); $client->containerList(); $clientWithHandler->containerInspect('container-name'); $asyncClient->containerStart('container-name'); $asyncClientWithHandler->containerStop('container-name'); $asyncClient->wait(); $asyncClientWithHandler->wait();
Configuration
You can switch default docker api version by set DOCKER_API_VERSION global env:
// Client factory use default value '1.41v' $_ENV['DOCKER_API_VERSION'] = '1.43v'
Also you should have /var/run/docker.sock in your system. This is default path for docker socker.
统计信息
- 总下载量: 26
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-09-07