# PHP Docker API Client

CI 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

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

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

# Manage Containers

PHP
// 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

BASH
bin/docker-api docker:list-containers

# ๐Ÿค Contributing

Pull Requests are welcome.

# ๐Ÿ“„ License

MIT License.

NORMAL โއ main README.md bun ยท astro ยท workers UTF-8 100%