PHPackages                             lrh/docker - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [DevOps &amp; Deployment](/categories/devops)
4. /
5. lrh/docker

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

lrh/docker
==========

docker operation composer

v1.0.0(6y ago)04MITPHPPHP &gt;=7.0.0

Since Jul 12Pushed 6y ago1 watchersCompare

[ Source](https://github.com/AdamExlu/docker)[ Packagist](https://packagist.org/packages/lrh/docker)[ RSS](/packages/lrh-docker/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

### 功能

[](#功能)

基于 docker-php/docker-php composer包，对常用的docker功能进行二次封装，使用更加简单易懂。

### 使用

[](#使用)

直接composer安装

```
composer require lrh/docker

```

使用说明
----

[](#使用说明)

对docker的操作都封装在lrh\\docker\\Client类里面

使用的第一步，创建一个lrh\\docker\\Client类对象，并连接docker

```
$client = new Client;
//连接docker，不传参数则连接本机docker,若连接远程docker： 192.0.0.1:2375
$client->connectDocker();

```

若要创建一个容器，先创建一个lrh\\docker\\model\\ContainerConfig类对象，将要创建的容器设置配置到相应的对象属性，然后传入创建容器方法

```
$config = new ContainerConfig;          //docker配置类
$config->setImage('centos:7');          //设置镜像
$config->setPorts([81 => 10002, 82 => 10003]);          //绑定端口
$config->setVolumes([ 'testVolumes:/root/temp' ]);      //挂载目录
$config->setMemory(1073741824);         //限制内存
$client->createContainer($config);      //创建容器

if( $res['status'] ){
    $id = $res['container_id'];
    $start_res = $client->startContainer($id);  //启动容器
    if( $start_res['status'] )
        echo '容器创建成功！';
    else
        echo '容器创建失败！';
}else{
    echo $res['info'];
}

```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2499d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/95edf271056678380f96f18e873c5a65a2ac6c7955845655a1ac9a1c2b99ad17?d=identicon)[Lorik](/maintainers/Lorik)

---

Top Contributors

[![AdamExlu](https://avatars.githubusercontent.com/u/25898100?v=4)](https://github.com/AdamExlu "AdamExlu (13 commits)")

### Embed Badge

![Health badge](/badges/lrh-docker/health.svg)

```
[![Health](https://phpackages.com/badges/lrh-docker/health.svg)](https://phpackages.com/packages/lrh-docker)
```

###  Alternatives

[deployer/deployer

Deployment Tool

11.0k25.4M207](/packages/deployer-deployer)[appwrite/server-ce

End to end backend server for frontend and mobile apps.

55.3k84.2k](/packages/appwrite-server-ce)[pragmarx/health

Laravel Server &amp; App Health Monitor and Notifier

2.0k1.0M2](/packages/pragmarx-health)[felixfbecker/language-server-protocol

PHP classes for the Language Server Protocol

22476.7M6](/packages/felixfbecker-language-server-protocol)[heroku/heroku-buildpack-php

Toolkit for starting a PHP application locally, with or without foreman, using the same config for PHP and Apache2/Nginx as on Heroku

8161.3M10](/packages/heroku-heroku-buildpack-php)[tiamo/phpas2

PHPAS2 is a php-based implementation of the EDIINT AS2 standard

4674.7k](/packages/tiamo-phpas2)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
