A modern PHP client for the Docker Engine API (v1.51+), built with JanePHP.
useWebProject\DockerApiClient\Client\DockerApiClientWrapper;
useWebProject\DockerApiClient\Service\DockerService;
$service = newDockerService(
DockerApiClientWrapper::create('http://localhost', '/var/run/docker.sock')
);// List and inspect containersforeach ($service->findAllContainer() as$container) {
echo"{$container->getName()}: " . ($container->running ? 'Running' : 'Stopped') . "";
// Extract env-based URLs$urls = $container->extractUrlsFromEnvVars(['VIRTUAL_HOST']);
}bin/docker-api docker:list-containersPull Requests are welcome.
MIT License.