Skip to content

Repository files navigation

PHP Docker API Client

CIReleasePHP VersionLatest Stable VersionTotal DownloadsLicense

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


💻 Usage

Initialize Service

useWebProject\DockerApiClient\Client\DockerApiClientWrapper;
useWebProject\DockerApiClient\Service\DockerService;
$service = newDockerService(
DockerApiClientWrapper::create('http://localhost', '/var/run/docker.sock')
);

Manage Containers

// List and inspect containersforeach ($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

Stars

2 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages