Skip to content

Instantly share code, notes, and snippets.

@rezen
Created April 6, 2020 01:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rezen/090c011656e9bda2003ee9bbae500bb6 to your computer and use it in GitHub Desktop.
Save rezen/090c011656e9bda2003ee9bbae500bb6 to your computer and use it in GitHub Desktop.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$config = new OpenAPI\Client\Configuration;
$config->setHost('http://localhost/v1.40');
$apiInstance = new OpenAPI\Client\Api\ContainerApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client([
'curl' => [
CURLOPT_UNIX_SOCKET_PATH => '/var/run/docker.sock' // If you are on mac ...
]
]),
$config,
);
try {
print_r($apiInstance->containerList(true));
} catch (Exception $e) {
echo 'Exception when calling ContainerApi->containerArchive: ', $e->getMessage(), PHP_EOL;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment