webproject-xyz/docker-api-client

A PHP docker API client generated from docker api swagger schema with jane

Installs: 5 903

Dependents: 1

Suggesters: 0

Security: 0

Stars: 2

Watchers: 1

Forks: 0

Open Issues: 4

pkg:composer/webproject-xyz/docker-api-client

1.3.2 2026-02-16 22:44 UTC

README

Tests Release PHP Version Latest Stable Version Total Downloads License

A modern PHP client for the Docker Engine API (v1.51+), built with JanePHP.

💻 Usage

Initialize Service

use WebProject\DockerApiClient\Client\DockerApiClientWrapper;
use WebProject\DockerApiClient\Service\DockerService;

$service = new DockerService(
    DockerApiClientWrapper::create('http://localhost', '/var/run/docker.sock')
);

Manage Containers

// List and inspect containers
foreach ($service->findAllContainer() as $container) {
    echo "{$container->getName()}: " . ($container->running ? 'Running' : 'Stopped') . "
";
    
    // Extract env-based URLs
    $urls = $container->extractUrlsFromEnvVars(['VIRTUAL_HOST']);
}

CLI Support

bin/docker-api docker:list-containers

🤝 Contributing

Pull Requests are welcome.

📄 License

MIT License.