Skip to content

Instantly share code, notes, and snippets.

@rezen
Created Apr 6, 2020
Embed
What would you like to do?
<?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