Skip to content

Latest commit

 

History

History
28 lines (17 loc) · 573 Bytes

README.md

File metadata and controls

28 lines (17 loc) · 573 Bytes

php-docker-wrapper

PHP wrapper class for docker CLI (feature incomplete).

Example

The following example tries to retrieve information about the container my-container.

$docker = new Docker();

if ($docker->isInstalled()) {

    if ($docker->isContainerExisting('my-container')) {

        if (!$docker->isContainerRunning('my-container')) {
            $docker->start('my-container');
        }

        $containerInfo = $docker->getContainerInfo('my-container');

        // .. do something with it

        $docker->stop('my-container');
    }
}