title: how to build docker image via php system()
body: <p>I am working to build a docker machine via php system method() its goes to 504 page. i have increased <code>fastcgi_read_timeout</code> size 300 to 6000 and <code>max_execution_time</code> size 300 to 3000. Stil  goes to 504 page.</p>
  
  <p><strong>my code:</strong>  <code>mybuild.php</code></p>
  
  <pre><code>  $docker_pull = system("cd $this-&gt;script_path/;sudo docker build -t reports .", $ret);
  
      if ($docker_pull != null) {
  
          print "efk Image pulled correctly";
  
      } else {
  
          echo "Error! While docker Pull";         
      }
  </code></pre>
  
  <p>This code works via run command line:</p>
  
  <pre><code>php mybuild.php $ag1 $ag2
  </code></pre>
  
  <p>but same file I call via php file its not works 
  mytest.php:</p>
  
  <pre><code>system("/usr/bin/php mybuild.php $arg1 $agrg2")
  </code></pre>
  
  <p>why? </p>
  
  <p>I add <code>www-data ALL=NOPASSWD: /usr/bin/docker</code>  to /etc/sudoers file.</p>
  
  <p><strong>note:</strong> docker container creates fine, but docker build only issue.</p>
  
  <p>Suggest me what i miss in this Configuration and suggest me any other way to did this.</p>