Beispiel #1
0
 public function run(Dockerfile $file)
 {
     $cmd = $this->generate();
     $proc = proc_open($cmd, [['pipe', 'r'], ['pipe', 'w'], ['pipe', 'w']], $pipes);
     fwrite($pipes[0], $file->generate());
     fclose($pipes[0]);
     $output = stream_get_contents($pipes[1]);
     $err = stream_get_contents($pipes[2]);
     return [$output, $err, proc_close($proc)];
 }
Beispiel #2
0
 public function installTo(Dockerfile $file)
 {
     if ($this->holder == null) {
         $this->holder = array('(kill -SIGSTOP $BASHPID)&', 'wait');
     }
     $content = array('#!/bin/bash');
     $content = $this->gen($content, $this->starter, 'start');
     $content = $this->gen($content, $this->stoper, 'stop', 'INT TERM');
     $content = $this->gen($content, $this->reloader, 'reload', 'HUP');
     $content = array_merge($content, $this->holder);
     $file->gStart(true)->textfileArray($content, $this->path)->chmod('a+x', $this->path)->gEnd();
 }