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.

Installs: 1

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/eloquage/docker-php

1.1.0 2026-02-07 21:11 UTC

This package is auto-updated.

Last update: 2026-02-07 21:13:34 UTC


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.