【发布时间】:2015-07-17 19:25:45
【问题描述】:
我正在尝试从我的 index.php 运行命令:
$output = shell_exec('docker images');
然后输出结果,
或以同样的方式运行新容器:
$output = shell_exec('docker run hello-world');
似乎我无法通过 php 运行任何 docker cmd。
如何正确操作?
【问题讨论】:
-
你是在容器外运行 PHP 吗?
-
是的。我尝试从主机上的网络浏览器运行它。
-
你的容器里有什么?它是网络服务器吗?如果是这样,由于端口冲突等原因,将无法在浏览器中查看输出。
标签: php shell docker ubuntu-14.04