-
-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathpush.php
More file actions
18 lines (13 loc) · 760 Bytes
/
push.php
File metadata and controls
18 lines (13 loc) · 760 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php
// this example shows how the imagePush() call can be used to publish a given image.
// this requires authorization and this example includes some invalid defaults.
require __DIR__ . '/../vendor/autoload.php';
$image = isset($argv[1]) ? $argv[1] : 'asd';
$auth = json_decode('{"username": "string", "password": "string", "email": "string", "serveraddress" : "string", "auth": ""}');
echo 'Pushing image "' . $image . '" (pass as argument to this example)' . PHP_EOL;
$client = new Clue\React\Docker\Client();
$client->imagePush($image, null, null, $auth)->then(function ($result) {
echo json_encode($result, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . PHP_EOL;
}, function (Exception $e) {
echo 'Error: ' . $e->getMessage() . PHP_EOL;
});