PHP code example of tortitas / docker-sdk

1. Go to this page and download the library: Download tortitas/docker-sdk 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/ */

    

tortitas / docker-sdk example snippets


use Tortitas\DockerSDK\DockerSDK;
use Tortitas\DockerSDK\Container;

$image = 'nginx:latest';

DockerSDK::pull($image);

$container = new Container(
  'my-nginx-php-container', 
  $image
);

$container->create()->start();

DockerSDK::list();