PHP code example of polkovnik-z / php-docker-client

1. Go to this page and download the library: Download polkovnik-z/php-docker-client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

polkovnik-z / php-docker-client example snippets


use IterativeCode\Component\DockerClient\DockerClient;

$docker = new DockerClient([
    'local_endpoint' => 'http://localhost:2375/v1.41', # Optional (default: http://localhost:2375)
]);


$exists = $docker->imageExists('436aed837ea2');
# true | false

$details = $docker->inspectImage('436aedXXXXXX');
# array | @throws Exception