eloquage/docker-php 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

eloquage/docker-php

Composer 安装命令:

composer require eloquage/docker-php

包简介

Docker Engine API client for Laravel with a built-in Livewire management UI. Connect via Unix socket, TCP, or TLS. Manage containers, images, networks, volumes, and Swarm from code or the included Flux UI.

README 文档

README

PHP 8.4 Laravel 12 Tests License Packagist Downloads

A comprehensive Docker Engine API client for Laravel with a built-in Livewire management UI.

Connect to your Docker daemon via Unix socket, TCP, or TLS. Use the fluent API in code or the included UI to manage containers, images, networks, volumes, and Swarm.

Features

🔌 Full API Coverage

100+ endpoints across the Docker Engine API v1.53 — containers, images, networks, volumes, Swarm, services, nodes, tasks, secrets, configs, plugins, build, exec, and distribution.

🖥️ Built-in Livewire UI

15 ready-to-use management components styled with Flux UI and dark mode support. Browse your dashboard, containers, images, networks, volumes, and the full Swarm surface — all from the browser.

⚡ Real-time Streaming

Watch image pulls with live progress bars powered by Server-Sent Events. Stream container logs and stats with multiplexed stream decoding built in.

🧩 Type-safe DTOs

First-class Data Transfer Objects for list and inspect responses — ImageSummary, ContainerSummary, SystemInfo, DiskUsage, and more — so you never work with raw arrays.

🗄️ Selective Caching

Saloon cache plugin for read-only requests (info, version, image inspect/history) with configurable TTLs. Keep things fast without stale data.

🔗 Flexible Connections

Connect via Unix socket (default), TCP, or TLS with full certificate support. Configurable timeouts and custom headers out of the box.

🐝 Docker Swarm Ready

Initialize, join, and leave clusters. Manage services, nodes, tasks, secrets, and configs from the UI or programmatically through the API.

✅ Thoroughly Tested

Lawman architectural expectations for the Saloon connector and requests. Pest-powered feature and unit tests with full mock support — no daemon required.

Quick start

1. Install

composer require eloquage/docker-php

2. Publish config

php artisan vendor:publish --tag=docker-php.config

3. Configure (default: Unix socket)

DOCKER_CONNECTION=unix
DOCKER_UNIX_SOCKET=/var/run/docker.sock
DOCKER_API_VERSION=v1.53

4. Open the UI at /docker (or your configured prefix).

Programmatic usage

use Eloquage\DockerPhp\Facades\DockerPhp;

// List containers
$response = DockerPhp::containers()->list(all: true);
$containers = $response->json();

// List images (returns DTOs)
$response = DockerPhp::images()->list();
$images = $response->dto(); // ImageSummary[]

// System info
$response = DockerPhp::system()->info();
$info = $response->dto(); // SystemInfo
$hostname = $info->name();

Errors are thrown as Eloquage\DockerPhp\Exceptions\DockerApiException with the daemon’s message.

Configuration overview

Env / config Default Description
DOCKER_CONNECTION unix unix, tcp, or tls
DOCKER_UNIX_SOCKET /var/run/docker.sock Socket path (unix)
DOCKER_HOST localhost Host (tcp/tls)
DOCKER_PORT 2375 Port (tcp/tls)
DOCKER_API_VERSION v1.53 Engine API version
DOCKER_PHP_UI_PREFIX docker URL prefix for the UI
DOCKER_PHP_CACHE_ENABLED true Cache for read-only requests

See config/docker-php.php and the documentation for the full reference.

UI preview

The UI includes a sidebar with Dashboard, Containers, Images, Volumes, Networks, and (when Swarm is initialized) Swarm, Services, Nodes, Tasks, Secrets, and Configs. The dashboard loads system info, version, and disk usage in parallel. Images support pull with progress bar (SSE), Docker Hub search, tag, inspect with history, and prune with feedback.

Testing

vendor/bin/pest --compact

Tests use Saloon’s MockClient; no Docker daemon is required. See Testing in the docs.

Livewire components use the same DockerPhp service and resources to drive the UI.

Documentation

Full documentation (getting started, configuration, API reference, UI guide, caching, streaming, testing) is published at:

https://eloquage.github.io/docker-php

Changelog

See changelog.md for what has changed recently.

Contributing

See contributing.md for details.

Security

If you discover any security-related issues, please email the maintainers instead of using the issue tracker.

License

MIT. See the license file for more information.

eloquage/docker-php 适用场景与选型建议

eloquage/docker-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 02 月 07 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「flux」 「laravel」 「API-Client」 「containers」 「docker」 「livewire」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 eloquage/docker-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 eloquage/docker-php 我们能提供哪些服务?
定制开发 / 二次开发

基于 eloquage/docker-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 2
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 36
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-02-07