Skip to content

a php client to communicate with the docker api

License

Notifications You must be signed in to change notification settings

WebProject-xyz/php-docker-api-client

Repository files navigation

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

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.

About

a php client to communicate with the docker api

Topics

Resources

License

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •  

Languages