title: Using Java To run a shell script to copy a file to docker returns an error
body: <p>I'm trying to use Java to execute a shell script that triggers a docker copy command. Everything I have tried has returned code 127 (command not found).</p>
  
  <pre><code>public static void main(String[] args)
  {
      System.out.println("Starting shell script");
      String script = "SendToDocker.sh";
      String scriptPath = "/path/";
      try {
          Process awk = new ProcessBuilder("/bin/bash", scriptPath + script).start();
          awk.waitFor();
          BufferedReader reader = new BufferedReader(new InputStreamReader(        
                  awk.getInputStream()));                                          
              String s;                                                                
              while ((s = reader.readLine()) != null) {                                
                System.out.println("Script output: " + s);
                System.out.println("output code: "+awk.exitValue());
              }      
      } catch (IOException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      } catch (InterruptedException e) {
          e.printStackTrace();
      }
      System.out.println("Finished");
  }
  </code></pre>
  
  <p>SendToDocker.sh</p>
  
  <pre><code>#!/bin/bash
  docker cp /path/asdf.csv 2d55a8445409:/
  </code></pre>
  
  <p>The script works perfectly fine if I run it in my terminal. Any help/ideas would be greatly appreciated.</p>