Servicedock: Webgui for Docker Swarm. Manage Docker Swarm a a Service.
 
 
 
 
 

9 lines
295 B

<?php
$container=$_REQUEST['container'];
$action=$_REQUEST['action'];
if (!preg_match(',^[a-f0-9]+$,', $container)) exit(1);
if (!preg_match(',start|stop|pause|unpause|rm,', $action)) exit(1);
exec('docker '.$action.' '.$container, $res, $ret);
if ($ret!=0) exit(1);
echo "executed $action";
?>