Method: CIDE::Docker#docker
- Defined in:
- lib/cide/docker.rb
#docker(*args, verbose: false, capture: false) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/cide/docker.rb', line 31 def docker(*args, verbose: false, capture: false) cmd = (['docker'] + args).map(&:to_s) p cmd if verbose if capture r, w = IO.pipe pid = Process.spawn(*cmd, out: w) w.close return r.read else pid = Process.spawn(*cmd) return 0 end ensure Process.wait(pid) exitstatus = $?.exitstatus raise Error, exitstatus if exitstatus > 0 end |