Ran across this thread. My solution: pass the path to the xml as the argument to the script. Should work with absolutely any xml
#!/usr/bin/php
<?
$docroot = "/usr/local/emhttp";
require_once "$docroot/plugins/dynamix.docker.manager/include/DockerClient.php";
$var = parse_ini_file('/var/local/emhttp/var.ini');
$cfg = parse_ini_file('/boot/config/docker.cfg');
$driver = DockerUtil::driver();
$custom = DockerUtil::custom();
$subnet = DockerUtil::network($custom);
$opts = xmlToCommand($argv[1]);
$cmd = str_replace("create ","run -d ",$opts[0]);
passthru($cmd);
?>